Functions | |
ATO_EXPORT void | ato_log_setlogfn (ato_logfunction logfunction) |
Override the default logging function. More... | |
ATO_EXPORT ato_eLoglevel | ato_log_name2level (const char *c) |
Convert the loglevel name to the enum equivalent. More... | |
ATO_EXPORT const char * | ato_log_level2name (ato_eLoglevel level) |
Convert the loglevel enum to the string equivalent. More... | |
ATO_EXPORT const char * | ato_log_id (ato_Log *log) |
The unique id of the logger - typically a guid. More... | |
ATO_EXPORT char | ato_log_outputtype (ato_Log *log) |
The output type - 'n'one, 'e'rr (stderr), 'out' (stdout), 'p'ath (dir/file) More... | |
ATO_EXPORT const char * | ato_log_path (ato_Log *log) |
The full path of the file being logged to if ato_log_outputtype() is path. More... | |
ATO_EXPORT const char * | ato_log_upath (ato_Log *log) |
The full 'unique' path, incorporating ato_log_id(), of the file being logged to if ato_log_outputtype() is path. More... | |
ATO_EXPORT size_t | ato_log_indentsize (ato_Log *log) |
Amount to indent each level - defaults to 2. More... | |
ATO_EXPORT size_t | ato_log_indentlevel (ato_Log *log) |
Indent level as determined by nested ato_log_start()/ato_log_end() calls. More... | |
ATO_EXPORT ato_eLoglevel | ato_loglevel (const char *library, const char *module) |
Target loglevel of any log calls within a library/module. More... | |
ATO_EXPORT void | ato_setloglevel (const char *library, unsigned long moduleidmask, ato_eLoglevel level) |
Set the loglevel for individual registered libraries/modules. More... | |
ATO_EXPORT bool | ato_logfiledump (const char *library, const char *module) |
For modules that dump content to files (to aid debugging), check if file dumping is on or off. More... | |
ATO_EXPORT void | ato_setlogfiledump (const char *library, unsigned long moduleidmask, bool filedump) |
For modules that dump content to files (to aid debugging), turn file dumping on or off. More... | |
ATO_EXPORT bool | ato_log_msg (ato_Log *log, ato_eLoglevel target, ato_eLoglevel current, const char *library, const char *module, const char *function, const char *format,...) |
Log message content (ATO_LOGSTATE_MSG) if current >= target. More... | |
ATO_EXPORT bool | ato_log_start (ato_Log *log, ato_eLoglevel target, ato_eLoglevel current, const char *library, const char *module, const char *function, const char *format,...) |
Log message header (ATO_LOGSTATE_OPEN) if current >= target. More... | |
ATO_EXPORT bool | ato_log_end (ato_Log *log, ato_eLoglevel target, ato_eLoglevel current, const char *library, const char *module, const char *function, bool doindentonly, const char *format,...) |
Log message trailer (ATO_LOGSTATE_CLOSE) if current >= target. More... | |
ATO_EXPORT void ato_log_setlogfn | ( | ato_logfunction | logfunction | ) |
Override the default logging function.
logfunction | the custom application log function to use |
ATO_EXPORT ato_eLoglevel ato_log_name2level | ( | const char * | c | ) |
Convert the loglevel name to the enum equivalent.
c | the log level as a string - only first character is significant |
ATO_EXPORT const char* ato_log_level2name | ( | ato_eLoglevel | level | ) |
Convert the loglevel enum to the string equivalent.
level | the log level enum |
ATO_EXPORT const char* ato_log_id | ( | ato_Log * | log | ) |
The unique id of the logger - typically a guid.
Used to uniquify the logfile name per thread.
log | the log object |
ATO_EXPORT char ato_log_outputtype | ( | ato_Log * | log | ) |
The output type - 'n'one, 'e'rr (stderr), 'out' (stdout), 'p'ath (dir/file)
log | the log object |
ATO_EXPORT const char* ato_log_path | ( | ato_Log * | log | ) |
The full path of the file being logged to if ato_log_outputtype() is path.
log | the log object |
ATO_EXPORT const char* ato_log_upath | ( | ato_Log * | log | ) |
The full 'unique' path, incorporating ato_log_id(), of the file being logged to if ato_log_outputtype() is path.
This will prefix the id before the file extension, so that logfile.log becomes logfile-id.log.
log | the log object |
ATO_EXPORT size_t ato_log_indentsize | ( | ato_Log * | log | ) |
Amount to indent each level - defaults to 2.
log | the log object |
ATO_EXPORT size_t ato_log_indentlevel | ( | ato_Log * | log | ) |
Indent level as determined by nested ato_log_start()/ato_log_end() calls.
log | the log object |
ATO_EXPORT ato_eLoglevel ato_loglevel | ( | const char * | library, |
const char * | module | ||
) |
Target loglevel of any log calls within a library/module.
library | name of library |
module | name of module within library |
ATO_EXPORT void ato_setloglevel | ( | const char * | library, |
unsigned long | moduleidmask, | ||
ato_eLoglevel | level | ||
) |
Set the loglevel for individual registered libraries/modules.
library | the library name - NULL indicates all. Current known libraries using this SDK are BASE, AKM, STM, CSR. See the relevant #defines e.g. ATO_BASE_LIBRARY |
moduleidmask | the modules each library registers - 0 indicates all. These allow bitwise or-ing |
level | the loglevel to use |
ATO_EXPORT bool ato_logfiledump | ( | const char * | library, |
const char * | module | ||
) |
For modules that dump content to files (to aid debugging), check if file dumping is on or off.
library | name of library |
module | name of module within library |
ATO_EXPORT void ato_setlogfiledump | ( | const char * | library, |
unsigned long | moduleidmask, | ||
bool | filedump | ||
) |
For modules that dump content to files (to aid debugging), turn file dumping on or off.
This has no affect on modules that do not dump files.
library | name of library |
moduleidmask | the modules each library registers - 0 indicates all. These allow bitwise or-ing |
filedump | TRUE to turn dumping on. |
ATO_EXPORT bool ato_log_msg | ( | ato_Log * | log, |
ato_eLoglevel | target, | ||
ato_eLoglevel | current, | ||
const char * | library, | ||
const char * | module, | ||
const char * | function, | ||
const char * | format, | ||
... | |||
) |
Log message content (ATO_LOGSTATE_MSG) if current >= target.
log | the log object |
target | the level the module is set at |
current | the level of the call |
library | call came from |
module | call came from |
function | call came from |
format | printf() format characters |
... | parameters |
ATO_EXPORT bool ato_log_start | ( | ato_Log * | log, |
ato_eLoglevel | target, | ||
ato_eLoglevel | current, | ||
const char * | library, | ||
const char * | module, | ||
const char * | function, | ||
const char * | format, | ||
... | |||
) |
Log message header (ATO_LOGSTATE_OPEN) if current >= target.
log | the log object |
target | the level the module is set at |
current | the level of the call |
library | call came from |
module | call came from |
function | call came from |
format | printf() format characters |
... | parameters |
ATO_EXPORT bool ato_log_end | ( | ato_Log * | log, |
ato_eLoglevel | target, | ||
ato_eLoglevel | current, | ||
const char * | library, | ||
const char * | module, | ||
const char * | function, | ||
bool | doindentonly, | ||
const char * | format, | ||
... | |||
) |
Log message trailer (ATO_LOGSTATE_CLOSE) if current >= target.
log | the log object |
target | the level the module is set at |
current | the level of the call |
library | call came from |
module | call came from |
function | call came from |
doindentonly | don't actually log anything - just adjust the indent level |
format | printf() format characters |
... | parameters |