Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# pvlogger.h File Reference

This file contains basic logger interfaces for common use across platforms. More...

`#include "oscl_base.h"`
`#include "oscl_vector.h"`
`#include "oscl_shared_ptr.h"`
`#include "oscl_base_alloc.h"`

Go to the source code of this file.

## Data Structures
class | PVLogger
## Defines
#define | PVLOGMSG_INST_REL 0
#define | PVLOGMSG_INST_PROF 1
#define | PVLOGMSG_INST_HLDBG 2
#define | PVLOGMSG_INST_MLDBG 3
#define | PVLOGMSG_INST_LLDBG 4
#define | PVLOGGER_INST_LEVEL 5
#define | _PVLOGGER_LOGMSG(LOGGER, LEVEL, MESSAGE)
#define | _PVLOGGER_LOGMSG_V(LOGGER, LEVEL, MESSAGE)
#define | _PVLOGGER_LOGBIN(LOGGER, LEVEL, MESSAGE)
#define | _PVLOGGER_LOGBIN_V(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_INST_LEVEL_SUPPORT 1
#define | PVLOGGER_LOGMSG_PVLOGMSG_INST_REL(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGMSG(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGMSG_V_PVLOGMSG_INST_REL(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGMSG_V(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGBIN_PVLOGMSG_INST_REL(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGBIN(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGBIN_V_PVLOGMSG_INST_REL(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGBIN_V(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGMSG_PVLOGMSG_INST_PROF(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGMSG(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGMSG_V_PVLOGMSG_INST_PROF(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGMSG_V(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGBIN_PVLOGMSG_INST_PROF(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGBIN(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGBIN_V_PVLOGMSG_INST_PROF(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGBIN_V(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGMSG_PVLOGMSG_INST_HLDBG(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGMSG(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGMSG_V_PVLOGMSG_INST_HLDBG(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGMSG_V(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGBIN_PVLOGMSG_INST_HLDBG(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGBIN(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGBIN_V_PVLOGMSG_INST_HLDBG(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGBIN_V(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGMSG_PVLOGMSG_INST_MLDBG(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGMSG(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGMSG_V_PVLOGMSG_INST_MLDBG(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGMSG_V(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGBIN_PVLOGMSG_INST_MLDBG(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGBIN(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGBIN_V_PVLOGMSG_V_INST_MLDBG(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGBIN_V(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGMSG_PVLOGMSG_INST_LLDBG(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGMSG(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGMSG_V_PVLOGMSG_INST_LLDBG(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGMSG_V(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGBIN_PVLOGMSG_INST_LLDBG(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGBIN(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGBIN_V_PVLOGMSG_INST_LLDBG(LOGGER, LEVEL, MESSAGE) _PVLOGGER_LOGBIN_V(LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGMSG(IL, LOGGER, LEVEL, MESSAGE) PVLOGGER_LOGMSG_ ## IL (LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGMSG_V(IL, LOGGER, LEVEL, MESSAGE) PVLOGGER_LOGMSG_V_ ## IL (LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGBIN(IL, LOGGER, LEVEL, MESSAGE) PVLOGGER_LOGBIN_ ## IL (LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOGBIN_V(IL, LOGGER, LEVEL, MESSAGE) PVLOGGER_LOGBIN_V_ ## IL (LOGGER, LEVEL, MESSAGE)
#define | PVLOGGER_LOG_USE_ONLY(x) x
#define | PVLOGGER_ENABLE 1
## Variables
const int32 | PVLOGGER_LEVEL_UNINTIALIZED = -1
const PVLogger::log_level_type | PVLOGMSG_EMERG = 0
const PVLogger::log_level_type | PVLOGMSG_ALERT = 1
const PVLogger::log_level_type | PVLOGMSG_CRIT = 2
const PVLogger::log_level_type | PVLOGMSG_ERR = 3
const PVLogger::log_level_type | PVLOGMSG_WARNING = 4
const PVLogger::log_level_type | PVLOGMSG_NOTICE = 5
const PVLogger::log_level_type | PVLOGMSG_INFO = 6
const PVLogger::log_level_type | PVLOGMSG_STACK_TRACE = 7
const PVLogger::log_level_type | PVLOGMSG_DEBUG = 8
const PVLogger::log_level_type | PVLOGMSG_FATAL_ERROR = PVLOGMSG_EMERG
const PVLogger::log_level_type | PVLOGMSG_NONFATAL_ERROR = PVLOGMSG_ERR
const PVLogger::log_level_type | PVLOGMSG_STATISTIC = PVLOGMSG_INFO
const PVLogger::log_level_type | PVLOGMSG_VERBOSE = PVLOGMSG_DEBUG

## Detailed Description

This file contains basic logger interfaces for common use across platforms.

This is the main entry point header file for the logger library. It should be the only one users directly include.

## Define Documentation

#define _PVLOGGER_LOGBIN | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) |

| Value:
    {\
        if (LOGGER)\
        {\
            if (LOGGER->IsActive(LEVEL))\
            {\
                LOGGER->LogMsgBuffers MESSAGE;\
            }\
        }\
    }

#define _PVLOGGER_LOGBIN_V | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) |

| Value:
    {\
        if (LOGGER)\
        {\
            if (LOGGER->IsActive(LEVEL))\
            {\
                LOGGER->LogMsgBuffersV MESSAGE;\
            }\
        }\
    }

#define _PVLOGGER_LOGMSG | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) |

| Value:
    {\
        if (LOGGER)\
        {\
            if (LOGGER->IsActive(LEVEL))\
            {\
                LOGGER->LogMsgString MESSAGE;\
            }\
        }\
    }

#define _PVLOGGER_LOGMSG_V | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) |

| Value:
    {\
        if (LOGGER)\
        {\
            if (LOGGER->IsActive(LEVEL))\
            {\
                LOGGER->LogMsgStringV MESSAGE;\
            }\
        }\
    }

#define PVLOGGER_ENABLE 1

| In case logging is compiled out, there is no need to compile the logger runtime code either.

#define PVLOGGER_INST_LEVEL 5

#define PVLOGGER_INST_LEVEL_SUPPORT 1

#define PVLOGGER_LOG_USE_ONLY | ( | x |  | ) | x

| Used to compile in/out lines of code that are used only for PVLogger macros. This code will be removed at compile time when PVLogger is disabled, i.e. Release mode. So do not put in any code that is necessary for correct functionality of the module

#define PVLOGGER_LOGBIN | ( | IL,
|  | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | PVLOGGER_LOGBIN_ ## IL (LOGGER, LEVEL, MESSAGE)

  | This is a binary API to log messages Parameters:
  IL | Instrumentation level.
  LOGGER | Pointer to the logger object, that acts as the logging control/interface point
  LEVEL | Log level of the message
  MESSAGE | Log Message which includes the message id, and message buffers that need to be logged.
Example Usage: PVLOGGER_LOGBIN (PVLOGMSG_INST_LLDBG, logger_1, PVLOGMSG_WARNING, (10, 3, msgBuf1Size, msgBuf1, msgBuf2Size, msgBuf2, msgBuf3Size, msgBuf3)); -This message contains THREE (ptr_len, ptr) pairs. Log level of this msg is PVLOGMSG_WARNING, message id is 10.

#define PVLOGGER_LOGBIN_PVLOGMSG_INST_HLDBG | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGBIN(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGBIN_PVLOGMSG_INST_LLDBG | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGBIN(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGBIN_PVLOGMSG_INST_MLDBG | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGBIN(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGBIN_PVLOGMSG_INST_PROF | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGBIN(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGBIN_PVLOGMSG_INST_REL | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGBIN(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGBIN_V | ( | IL,
|  | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | PVLOGGER_LOGBIN_V_ ## IL (LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGBIN_V_PVLOGMSG_INST_HLDBG | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGBIN_V(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGBIN_V_PVLOGMSG_INST_LLDBG | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGBIN_V(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGBIN_V_PVLOGMSG_INST_PROF | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGBIN_V(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGBIN_V_PVLOGMSG_INST_REL | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGBIN_V(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGBIN_V_PVLOGMSG_V_INST_MLDBG | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGBIN_V(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGMSG | ( | IL,
|  | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | PVLOGGER_LOGMSG_ ## IL (LOGGER, LEVEL, MESSAGE)

  | This is the text based API to log messages Parameters:
  IL | Instrumentation level.
  LOGGER | Pointer to the logger object, that acts as the logging control/interface point
  LEVEL | Log level of the message
  MESSAGE | Log Message which includes the message id, and any kind of formatting information
Example Usage: PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG, logger_1, PVLOGMSG_WARNING, (13, "Test Messsage to Node 1 ")); -This message of log level PVLOGMSG_WARNING, and has a message id of 13

#define PVLOGGER_LOGMSG_PVLOGMSG_INST_HLDBG | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGMSG(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGMSG_PVLOGMSG_INST_LLDBG | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGMSG(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGMSG_PVLOGMSG_INST_MLDBG | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGMSG(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGMSG_PVLOGMSG_INST_PROF | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGMSG(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGMSG_PVLOGMSG_INST_REL | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGMSG(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGMSG_V | ( | IL,
|  | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | PVLOGGER_LOGMSG_V_ ## IL (LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGMSG_V_PVLOGMSG_INST_HLDBG | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGMSG_V(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGMSG_V_PVLOGMSG_INST_LLDBG | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGMSG_V(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGMSG_V_PVLOGMSG_INST_MLDBG | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGMSG_V(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGMSG_V_PVLOGMSG_INST_PROF | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGMSG_V(LOGGER, LEVEL, MESSAGE)

#define PVLOGGER_LOGMSG_V_PVLOGMSG_INST_REL | ( | LOGGER,
|  | LEVEL,
|  | MESSAGE |  | ) | _PVLOGGER_LOGMSG_V(LOGGER, LEVEL, MESSAGE)

#define PVLOGMSG_INST_HLDBG 2

| High Level Debug Layer This layer should contain messages that have very minimal impact on performance, but are at lower level (i.e., provide more information) than would be appropriate in a shipping product. The messages are probably used to gather information and validate proper functionality at a high level as might be appropriate for IOT, stress testing, or QA testing.

#define PVLOGMSG_INST_LLDBG 4

| Low Level Debug Layer This layer should contain messages for early functional testing. The messages are typically at a very low-level and allow testing the functionality of individual modules and components. Messages at this layer will typically have a performance impact (sometimes significant) due to the fact that they are at such a low level.

#define PVLOGMSG_INST_MLDBG 3

| Mid Level Debug Layer This layer should contain messages that are useful in the middle stages of the development cycle where major components are being integrated. The components themselves should already be well-tested so the emphasis is on interfaces between these components and integration testing. Messages at this layer may have some performance impact.

#define PVLOGMSG_INST_PROF 1

| Profile Layer The profile layer is used for messages and information related to messuring and reporting performance-related information.

#define PVLOGMSG_INST_REL 0

| Release Layer The release layer should only be used for messages that should remain in the final release. In certain cases all messaging may be disabled depending on customer requirements. However, when allowed the release layer should contain information that will be useful diagnosing problems in a released product (perhaps after entering a diagnostic mode), but with absolutely minimal performance impact when disabled at runtime.

## Variable Documentation

const int32 PVLOGGER_LEVEL_UNINTIALIZED = -1

const PVLogger::log_level_type PVLOGMSG_ALERT = 1

| action must be taken immediately

const PVLogger::log_level_type PVLOGMSG_CRIT = 2

| critical conditions

const PVLogger::log_level_type PVLOGMSG_DEBUG = 8

| debug-level messages

const PVLogger::log_level_type PVLOGMSG_EMERG = 0

| system is unusable

const PVLogger::log_level_type PVLOGMSG_ERR = 3

| error conditions

const PVLogger::log_level_type PVLOGMSG_FATAL_ERROR = PVLOGMSG_EMERG

const PVLogger::log_level_type PVLOGMSG_INFO = 6

| informational

const PVLogger::log_level_type PVLOGMSG_NONFATAL_ERROR = PVLOGMSG_ERR

const PVLogger::log_level_type PVLOGMSG_NOTICE = 5

| normal but significant condition

const PVLogger::log_level_type PVLOGMSG_STACK_TRACE = 7

| function enter and exit

const PVLogger::log_level_type PVLOGMSG_STATISTIC = PVLOGMSG_INFO

const PVLogger::log_level_type PVLOGMSG_VERBOSE = PVLOGMSG_DEBUG

const PVLogger::log_level_type PVLOGMSG_WARNING = 4

| warning conditions