|
libUPnP 1.14.31
|
#include "config.h"#include "ithread.h"#include "ixml.h"#include "upnp.h"#include "upnpdebug.h"#include <errno.h>#include <stdarg.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "posix_overwrites.h"
Functions | |
| int | UpnpInitLog (void) |
| Initialize the log files. More... | |
| void | UpnpSetLogLevel (Upnp_LogLevel log_level) |
Set the log level (see Upnp_LogLevel). More... | |
| void | UpnpCloseLog (void) |
| Closes the log files. More... | |
| 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. More... | |
| static int | DebugAtThisLevel (Upnp_LogLevel DLevel, Dbg_Module Module) |
| static void | UpnpDisplayFileAndLine (FILE *fp, const char *DbgFileName, int DbgLineNo, Upnp_LogLevel DLevel, Dbg_Module Module) |
| void | UpnpPrintf (Upnp_LogLevel DLevel, Dbg_Module Module, const char *DbgFileName, int DbgLineNo, const char *FmtStr,...) |
| Prints the debug statement either on the standard output or log file along with the information from where this debug statement is coming. More... | |
| 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. More... | |
Variables | |
| static ithread_mutex_t | GlobalDebugMutex |
| static Upnp_LogLevel | g_log_level = UPNP_DEFAULT_LOG_LEVEL |
| static FILE * | fp |
| static int | is_stderr |
| static int | setlogwascalled |
| static int | initwascalled |
| static char * | fileName |
| void UpnpCloseLog | ( | void | ) |
Closes the log files.
| FILE * UpnpGetDebugFile | ( | Upnp_LogLevel | level, |
| 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. |
| int UpnpInitLog | ( | void | ) |
Initialize the log files.
Referenced by UpnpInitPreamble().
| void UpnpPrintf | ( | Upnp_LogLevel | DLevel, |
| Dbg_Module | Module, | ||
| const char * | DbgFileName, | ||
| int | DbgLineNo, | ||
| const char * | FmtStr, | ||
| ... | |||
| ) |
Prints the debug statement 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. |
Referenced by FreeHandle(), gena_process_subscription_request(), gena_validate_delivery_urls(), GenaAutoRenewSubscription(), get_port(), http_MakeMessage(), NewRequestHandler(), notify_send_and_recv(), print_http_headers(), PrintHandleInfo(), printService(), printServiceList(), printServiceTable(), PrintThreadPoolStats(), UpnpAcceptSubscription(), UpnpAcceptSubscriptionExt(), UpnpFinish(), UpnpGetIfInfo(), UpnpGetServiceVarStatus(), UpnpGetServiceVarStatusAsync(), UpnpInitPreamble(), UpnpInitStartServers(), UpnpNotify(), UpnpNotifyExt(), UpnpRegisterClient(), UpnpRegisterRootDevice3(), UpnpRenewSubscription(), UpnpRenewSubscriptionAsync(), UpnpSearchAsync(), UpnpSendAction(), UpnpSendActionAsync(), UpnpSendActionEx(), UpnpSendActionExAsync(), UpnpSendAdvertisement(), UpnpSendAdvertisementLowPower(), UpnpSetMaxSubscriptions(), UpnpSetMaxSubscriptionTimeOut(), UpnpSubscribe(), UpnpSubscribeAsync(), UpnpThreadDistribution(), UpnpUnRegisterClient(), UpnpUnRegisterRootDevice(), UpnpUnRegisterRootDeviceLowPower(), UpnpUnSubscribe(), and UpnpUnSubscribeAsync().
| 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. |
| void UpnpSetLogLevel | ( | Upnp_LogLevel | log_level | ) |
|
static |
Global log level
Referenced by UpnpSetLogLevel().
|
static |
Mutex to synchronize all the log file operations in the debug mode