![]() |
das2C
das core C utilities (v3)
|
Library initialization, error handling, logging and a few minor libc extensions. More...
Typedefs | |
| typedef int | DasErrCode |
| return code type 0 indicates success, negative integer indicates failure | |
Functions | |
| DAS_API int | daslog_level (void) |
| Get the log level. | |
| DAS_API int | daslog_setlevel (int nLevel) |
| Set the logging level for this thread. | |
| DAS_API int | daslog_strlevel (const char *sLevel) |
| Get a logging level integer from a string. | |
| DAS_API const char * | daslog_levelstr (int nLevel) |
| The opposite of daslog_strlevel(), returns a string appropriate for the log level indicated. | |
| DAS_API bool | daslog_set_showline (int nLevel) |
| Output source file and line numbers for messages at or above this level. | |
| DAS_API das_log_handler_t | daslog_sethandler (das_log_handler_t new_handler) |
| Install a new message handler function for this thread. | |
Library initialization, error handling, logging and a few minor libc extensions.
| DAS_API int daslog_level | ( | void | ) |
Get the log level.
| DAS_API int daslog_setlevel | ( | int | nLevel | ) |
Set the logging level for this thread.
| nLevel | Set to one of
|
| DAS_API int daslog_strlevel | ( | const char * | sLevel | ) |
Get a logging level integer from a string.
This function may safely be called prior to das_init()
| sLevel | One of "crit", "err", "warn", "info", "debug", "trace". Case is not significant, extra letters after the first are actually ignored. |
| DAS_API const char * daslog_levelstr | ( | int | nLevel | ) |
The opposite of daslog_strlevel(), returns a string appropriate for the log level indicated.
Is also safe to call prior to das_init()
| nLevel | an integer in the range of 0 to 254 |
| DAS_API das_log_handler_t daslog_sethandler | ( | das_log_handler_t | new_handler | ) |
Install a new message handler function for this thread.
The default message handler just prints to stderr, which is not very efficient, nor is it appropriate for GUI applications.
| new_handler | The new message handler, or NULL to set to the default handler. |