![]() |
m2mb API docs
25.30.003
m2mb API sets documentation
|
Base trace system for m2m application. More...
#include <string.h>Go to the source code of this file.
Macros | |
| #define | __FILENAMEI__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) |
| #define | __FILENAMER__ (strrchr(__FILENAMEI__, '/') ? strrchr(__FILENAMEI__, '/') + 1 : __FILENAMEI__) |
| #define | __MODULE__ __FILENAMER__ |
| #define | m2mb_trace_printf(_class, level, format, ...) m2mb_trace_print_##level( _class, level, format, ##__VA_ARGS__ ) |
| #define | m2mb_trace_print_M2MB_TL_FATAL(_class, level, format, ...) m2mb_trace_file_line_printf(__MODULE__, __LINE__, _class, level, format, ##__VA_ARGS__) |
| #define | m2mb_trace_print_M2MB_TL_ERROR(_class, level, format, ...) m2mb_trace_file_line_printf(__MODULE__, __LINE__, _class, level, format, ##__VA_ARGS__) |
| #define | m2mb_trace_print_M2MB_TL_WARNING(_class, level, format, ...) m2mb_trace_file_line_printf(__MODULE__, __LINE__, _class, level, format, ##__VA_ARGS__) |
| #define | m2mb_trace_print_M2MB_TL_LOG(_class, level, format, ...) m2mb_trace_file_line_printf(__MODULE__, __LINE__, _class, level, format, ##__VA_ARGS__) |
| #define | m2mb_trace_print_M2MB_TL_DEBUG(_class, level, format, ...) m2mb_trace_file_line_printf(__MODULE__, __LINE__, _class, level, format, ##__VA_ARGS__) |
| #define | SUBSYS_TRACE_TABLE |
| #define | SUB_TR_AZ(a, b) a, |
Typedefs | |
| typedef HANDLE | M2MB_TRACE_HANDLE |
Functions | |
| M2MB_RESULT_E | m2mb_trace_init (void) |
| Base trace system initializazion. More... | |
| M2MB_RESULT_E | m2mb_trace_deinit (void) |
| Base trace system deinitializazion. More... | |
| M2MB_RESULT_E | m2mb_trace_enable (M2MB_TRACE_CLASS traceClass) |
| Base trace abilitation. More... | |
| M2MB_RESULT_E | m2mb_trace_disable (M2MB_TRACE_CLASS traceClass) |
| Base trace disabilitation. More... | |
| M2MB_RESULT_E | m2mb_trace_file_line_printf (const char *file, int line, M2MB_TRACE_CLASS _class, M2MB_TRACE_LEVEL level, char *fmt,...) |
| Base trace printf with file and line info. More... | |
Base trace system for m2m application.
m2m/m2m_common/m2mb_inc/m2mb_trace.h
@notes Dependencies: stdarg.h, m2mb_types.h
| #define SUBSYS_TRACE_TABLE |
| M2MB_RESULT_E m2mb_trace_deinit | ( | void | ) |
Base trace system deinitializazion.
This function deinitialize and free the structure needed for the trace If there are no other log connections from other Apps close also the ports USB/UART open (if any)
Example
| M2MB_RESULT_E m2mb_trace_disable | ( | M2MB_TRACE_CLASS | traceClass | ) |
Base trace disabilitation.
This function disaables a specific trace class
| [in] | traceClass | Class of the trace to be disabled If the log is not active, doesn't do anything. If the traceClass deactivated is the only active, it deactivates the trace |
Example
| M2MB_RESULT_E m2mb_trace_enable | ( | M2MB_TRACE_CLASS | traceClass | ) |
Base trace abilitation.
This function enables a specific trace class
| [in] | traceClass | Class of the trace to be enabled at a M2MB_TRACE_LEVEL of M2MB_TL_DEBUG (5) If it is used after m2mb_trace_init, it activates the selected trace class. If it is used before or instead of m2mb_trace_init, it bypasses any reading of log_az.ini and activates the trace as LOG_TRACE with only the selected trace class activated |
Example
| M2MB_RESULT_E m2mb_trace_file_line_printf | ( | const char * | file, |
| int | line, | ||
| M2MB_TRACE_CLASS | _class, | ||
| M2MB_TRACE_LEVEL | level, | ||
| char * | fmt, | ||
| ... | |||
| ) |
Base trace printf with file and line info.
Print formatted data to to trace system including file and line information.
| [in] | file | String containing the name of the file from where the trace is called |
| [in] | line | String containing the line in the file from where the trace is called |
| [in] | traceClass | Enum from M2MB_TRACE_CLASS that specifies class of the trace |
| [in] | level | Enum from M2MB_TRACE_LEVEL that specifies level of the trace |
| [in] | fmt | Format string for printf |
| [in] | ... | Unnamed arguments |
Example
| M2MB_RESULT_E m2mb_trace_init | ( | void | ) |
Base trace system initializazion.
This function collects all necessary initializatione for the base trace system If there is no log_az.ini, all the classes to a M2MB_TRACE_LEVEL of M2MB_TL_DEBUG (5), that is all traces will be shown. ( user case )
Example