Manage Debug messages with levels "critical" to "all". More...
#include <config.hpp>
#include <upnpdebug.hpp>
#include <UPnPsdk/synclog.hpp>
#include <umock/pthread.hpp>
#include <umock/stdio.hpp>
Go to the source code of this file.
Functions | |
int | UpnpInitLog () |
Initialize the log files. | |
void | UpnpSetLogLevel (Upnp_LogLevel log_level) |
Set the log level (see Upnp_LogLevel ). | |
void | UpnpCloseLog () |
Closes the log files. | |
void | UpnpSetLogFileNames (const char *newFileName, const char *ignored) |
Set the name for the log file. There used to be 2 separate files. The second parameter has been kept for compatibility but is ignored. Use a NULL file name for logging to stderr. | |
static int | DebugAtThisLevel (Upnp_LogLevel DLevel, Dbg_Module Module) |
Check Debug level. | |
static void | UpnpDisplayFileAndLine (FILE *a_fp, const char *DbgFileName, int DbgLineNo, Upnp_LogLevel DLevel, Dbg_Module Module) |
Display File and Line. | |
void | UpnpPrintf (Upnp_LogLevel DLevel, Dbg_Module Module, const char *DbgFileName, int DbgLineNo, const char *FmtStr,...) |
Prints the debug statement. | |
FILE * | UpnpGetDebugFile (Upnp_LogLevel DLevel, Dbg_Module Module) |
Check if the module is turned on for debug and returns the file descriptor corresponding to the debug level. . | |
Variables | |
pthread_mutex_t | anonymous_namespace{upnpdebug.cpp}::debug_mutex |
static Upnp_LogLevel | g_log_level = UPNP_DEFAULT_LOG_LEVEL |
static FILE * | filed |
static int | setlogwascalled |
static int | initwascalled |
static char * | fileName |
Manage Debug messages with levels "critical" to "all".
Definition in file upnpdebug.cpp.
#define UPNP_DEBUG_C |
Definition at line 38 of file upnpdebug.cpp.
int UpnpInitLog | ( | void | ) |
Initialize the log files.
Definition at line 77 of file upnpdebug.cpp.
void UpnpSetLogLevel | ( | Upnp_LogLevel | log_level | ) |
Set the log level (see Upnp_LogLevel
).
[in] | log_level | Log level. |
Definition at line 110 of file upnpdebug.cpp.
void UpnpCloseLog | ( | void | ) |
Closes the log files.
Definition at line 116 of file upnpdebug.cpp.
void UpnpSetLogFileNames | ( | const char * | newFileName, |
const char * | ignored | ||
) |
Set the name for the log file. There used to be 2 separate files. The second parameter has been kept for compatibility but is ignored. Use a NULL file name for logging to stderr.
[in] | newFileName | Name of the log file. |
[in] | ignored | Ignored. |
Definition at line 138 of file upnpdebug.cpp.
|
static |
Check Debug level.
Definition at line 153 of file upnpdebug.cpp.
|
static |
Display File and Line.
Definition at line 163 of file upnpdebug.cpp.
void UpnpPrintf | ( | Upnp_LogLevel | DLevel, |
Dbg_Module | Module, | ||
const char * | DbgFileName, | ||
int | DbgLineNo, | ||
const char * | FmtStr, | ||
... | |||
) |
Prints the debug statement.
Prints either on the standard output or log file along with the information from where this debug statement is coming.
[in] | DLevel | The level of the debug logging. It will decide whether debug statement will go to standard output, or any of the log files. |
[in] | Module | debug will go in the name of this module. |
[in] | DbgFileName | Name of the file from where debug statement is coming. |
[in] | DbgLineNo | Line number of the file from where debug statement is coming. |
[in] | FmtStr | Printf like format specification. |
[in] | ... | Printf like Variable number of arguments that will go in the debug statement. |
Definition at line 244 of file upnpdebug.cpp.
FILE * UpnpGetDebugFile | ( | Upnp_LogLevel | DLevel, |
Dbg_Module | Module | ||
) |
Check if the module is turned on for debug and returns the file descriptor corresponding to the debug level. .
[in] | DLevel | The level of the debug logging. It will decide whether debug statement will go to standard output, or any of the log files. |
[in] | Module | debug will go in the name of this module. |
Definition at line 279 of file upnpdebug.cpp.
|
static |
Global log level
Definition at line 61 of file upnpdebug.cpp.
|
static |
Output file descriptor
Definition at line 64 of file upnpdebug.cpp.
|
static |
Set if the user called setlogfilename() or setloglevel()
Definition at line 67 of file upnpdebug.cpp.
|
static |
The UPnP Debug module is initialized
Definition at line 69 of file upnpdebug.cpp.
|
static |
Name of the output file. We keep a copy
Definition at line 71 of file upnpdebug.cpp.