ADTF  v2.14.3
log.h File Reference

Standard log functionality. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cLogger
 cLogger class to hold the current LogLevel More...
 

Namespaces

 adtf_util
 The adtf_util defines the namespace for all functionality that is provided by the definitions and the default implementations within the library adtfutilXXX.a/ adtfutilXXX.lib.
 

Macros

#define LOG_LEVEL_DUMP   "dump"
 internal string to represent the dump level
 
#define LOG_LEVEL_INFO   "info"
 internal string to represent the info level
 
#define LOG_LEVEL_WARNING   "warning"
 internal string to represent the warning level
 
#define LOG_LEVEL_ERROR   "error"
 internal string to represent the error level
 
#define LOG_LEVEL_EXCEPTION   "exception"
 internal string to represent the exception level
 
#define LOG_FN_OUTPUT(strMsg, nLogLevel)    A_UTILS_NS::_fnLogOutput(( strMsg ), ( nLogLevel ), __FILE__, (tUInt32) __LINE__, ERR_NOERROR)
 internal macro to forward log messages More...
 
#define LOG_DUMP_UTILS(strMsg)
 Logging dump messages by utils log slot. These messages will only be shown in debug mode.
 
#define LOG_INFO_UTILS(strMsg)    LOG_FN_OUTPUT(( strMsg ), A_UTILS_NS::LOG_LVL_INFO)
 Logging info messages by utils log slot.
 
#define LOG_WARNING_UTILS(strMsg)    LOG_FN_OUTPUT(( strMsg ), A_UTILS_NS::LOG_LVL_WARNING)
 Logging warning messages by utils log slot.
 
#define LOG_ERROR_UTILS(strMsg)    LOG_FN_OUTPUT(( strMsg ), A_UTILS_NS::LOG_LVL_ERROR)
 Logging error messages by utils log slot.
 
#define LOG_DUMP(strMsg)    LOG_DUMP_UTILS(strMsg)
 Logging dump messages by utils log slot.
 
#define LOG_INFO(strMsg)    LOG_INFO_UTILS(strMsg)
 Logging info messages by utils log slot.
 
#define LOG_WARNING(strMsg)    LOG_WARNING_UTILS(strMsg)
 Logging warning messages by utils log slot.
 
#define LOG_ERROR(strMsg)    LOG_ERROR_UTILS(strMsg)
 Logging error messages by utils log slot.
 
#define LOG_REGISTER(pfn)    A_UTILS_NS::_fnLogRegister(pfn)
 Register a function as logging slot.
 
#define LOG_UNREGISTER(pfn)    A_UTILS_NS::_fnLogUnregister(pfn)
 Unregister a function as logging slot.
 
#define LOG_REGISTER_RAW(pfn)    A_UTILS_NS::_fnLogRegisterRaw(pfn)
 Register a function as raw logging slot.
 
#define LOG_UNREGISTER_RAW(pfn)    A_UTILS_NS::_fnLogUnregisterRaw(pfn)
 Unregister a function as raw logging slot.
 
#define LOG_DUMPF1(f, a1)   LOG_DUMP(A_UTILS_NS::cString::Format(f,a1))
 Log a dump message with a specified format and one argument.
 
#define LOG_DUMPF2(f, a1, a2)   LOG_DUMP(A_UTILS_NS::cString::Format(f,a1,a2))
 Log a dump message with a specified format and two arguments.
 
#define LOG_DUMPF3(f, a1, a2, a3)   LOG_DUMP(A_UTILS_NS::cString::Format(f,a1,a2,a3))
 Log a dump message with a specified format and three arguments.
 
#define LOG_DUMPF4(f, a1, a2, a3, a4)   LOG_DUMP(A_UTILS_NS::cString::Format(f,a1,a2,a3,a4))
 Log a dump message with a specified format and four arguments.
 
#define LOG_DUMPF5(f, a1, a2, a3, a4, a5)   LOG_DUMP(A_UTILS_NS::cString::Format(f,a1,a2,a3,a4,a5))
 Log a dump message with a specified format and five arguments.
 
#define RETURN_AND_LOG_ERROR(code)
 Log error code to console and return from the current function. More...
 
#define RETURN_AND_LOG_ERROR_STR(code, desc)
 Log custom error description to console and return from the current function. More...
 
#define RETURN_IF_FAILED_AND_LOG_ERROR_STR(code, desc)
 Log custom error description to console and return from the current function. More...
 

Typedefs

typedef bool(* tA_UTILS_LogOutputFunction) (const tChar *pcMessage, const tChar *pcLevel, const tChar *pcModuleName, tUInt32 u32Line, tResult stCode)
 Definition of the log output function which is used.
 
typedef bool(* tA_UTILS_LogOutputFunctionRaw) (const tChar *pcText)
 Definition of the raw log output function.
 

Enumerations

enum  tLogLevel {
  LOG_LVL_NONE = 0, LOG_LVL_EXCEPTION = 1, LOG_LVL_ERROR = 2, LOG_LVL_WARNING = 3,
  LOG_LVL_INFO = 4, LOG_LVL_DUMP = 5
}
 internal integer to represent the LogLevels
 

Functions

void _fnLogOutputRaw (const tChar *pcMessage)
 Internally used logging function. More...
 
void _fnLogOutput (const tChar *strMessage, tLogLevel nLogLevel, const tChar *strModuleName, tUInt32 u32Line, tResult stCode)
 Internally used logging function. More...
 
void _fnLogRegister (tA_UTILS_LogOutputFunction pfnLog)
 Internally used function to register log output function. More...
 
void _fnLogUnregister (tA_UTILS_LogOutputFunction pfnLog)
 Internally used function to unregister log output function. More...
 
void _fnLogRegisterRaw (tA_UTILS_LogOutputFunctionRaw pfnLog)
 Internally used function to register raw log output function. More...
 
void _fnLogUnregisterRaw (tA_UTILS_LogOutputFunctionRaw pfnLog)
 Internally used function to unregister raw log output function. More...
 

Detailed Description

Standard log functionality.

To temporarily switch on logging of all values returned by RETURN_ERROR(...) in your code, use #define ENABLE_VERBOSE_RETURN_LOG.

Copyright © Audi Electronics Venture GmbH. All rights reserved.

Author
ELAMIHA
Date
2014-05-29 19:50:26 +0200 (Do, 29 Mai 2014)
Revision
678

Definition in file log.h.

Macro Definition Documentation

#define LOG_FN_OUTPUT (   strMsg,
  nLogLevel 
)    A_UTILS_NS::_fnLogOutput(( strMsg ), ( nLogLevel ), __FILE__, (tUInt32) __LINE__, ERR_NOERROR)

internal macro to forward log messages

Parameters
[in]strMsglog messages
[in]nLogLevellevel of the log message
See also
enum A_UTILS_NS::tLogLevel
#define RETURN_AND_LOG_ERROR (   code)
Value:
{ \
A_UTILS_NS::_fnLogOutput(( A_UTILS_NS::cUtilsError::GetDescription(code) ), A_UTILS_NS::LOG_LVL_ERROR, __FILE__, (tUInt32) __LINE__, (code)); \
return (code); \
}
void _fnLogOutput(const tChar *strMessage, tLogLevel nLogLevel, const tChar *strModuleName, tUInt32 u32Line, tResult stCode)
Internally used logging function.
uint32_t tUInt32
type definition for unsigned integer values (32bit) (platform and compiler independent type)...
Definition: types.h:30

Log error code to console and return from the current function.

This requires the calling function's return type to be tResult.

Definition at line 195 of file log.h.

#define RETURN_AND_LOG_ERROR_STR (   code,
  desc 
)
Value:
{ \
A_UTILS_NS::_fnLogOutput(( desc ), A_UTILS_NS::LOG_LVL_ERROR, __FILE__, (tUInt32) __LINE__, (code)); \
return (code); \
}
void _fnLogOutput(const tChar *strMessage, tLogLevel nLogLevel, const tChar *strModuleName, tUInt32 u32Line, tResult stCode)
Internally used logging function.
uint32_t tUInt32
type definition for unsigned integer values (32bit) (platform and compiler independent type)...
Definition: types.h:30

Log custom error description to console and return from the current function.

This requires the calling function's return type to be tResult.

Definition at line 203 of file log.h.

#define RETURN_IF_FAILED_AND_LOG_ERROR_STR (   code,
  desc 
)
Value:
{ \
tResult __err_code = code; \
if (IS_FAILED(__err_code)){ A_UTILS_NS::_fnLogOutput(( desc ), A_UTILS_NS::LOG_LVL_ERROR, __FILE__, (tUInt32) __LINE__, (code)); \
return (__err_code); }\
}
void _fnLogOutput(const tChar *strMessage, tLogLevel nLogLevel, const tChar *strModuleName, tUInt32 u32Line, tResult stCode)
Internally used logging function.
uint32_t tUInt32
type definition for unsigned integer values (32bit) (platform and compiler independent type)...
Definition: types.h:30
#define IS_FAILED(s)
Check if result is failed.
Definition: error.h:41

Log custom error description to console and return from the current function.

This requires the calling function's return type to be tResult.

Definition at line 211 of file log.h.


Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Fri Mar 22 2019 by doxygen 1.8.10)