libUPnP
1.8.0
|
Go to the source code of this file.
Defines | |
#define | UPNP_DEFAULT_LOG_LEVEL UPNP_ALL |
Functions | |
int | UpnpInitLog (void) |
Initialize the log files. | |
void | UpnpSetLogLevel (Upnp_LogLevel log_level) |
Set the log level (see Upnp_LogLevel ). | |
void | UpnpCloseLog (void) |
Closes the log files. | |
void | UpnpSetLogFileNames (const char *ErrFileName, const char *InfoFileName) |
Set the name for error and information files, respectively. | |
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. | |
int | DebugAtThisLevel (Upnp_LogLevel DLevel, Dbg_Module Module) |
Returns true if debug output should be done in this 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. | |
void | UpnpDisplayFileAndLine (FILE *fd, const char *DbgFileName, int DbgLineNo) |
Writes the file name and file number from where debug statement is coming to the log file. | |
void | UpnpDisplayBanner (FILE *fd, const char **lines, size_t size, int starlength) |
Writes the buffer in the file as per the requested banner. | |
void | PrintThreadPoolStats (ThreadPool *tp, const char *DbgFileName, int DbgLineNo, const char *msg) |
Prints thread pool statistics. | |
Upnp_LogLevel | |
The user has the option to select 4 different types of debugging levels, see
| |
enum | Upnp_Module { SSDP, SOAP, GENA, TPOOL, MSERV, DOM, API, HTTP } |
enum | Upnp_LogLevel_e { UPNP_CRITICAL, UPNP_PACKET, UPNP_INFO, UPNP_ALL } |
typedef enum Upnp_Module | Dbg_Module |
typedef enum Upnp_LogLevel_e | Upnp_LogLevel |
#define UPNP_DEFAULT_LOG_LEVEL UPNP_ALL |
Default log level : see Upnp_LogLevel
int DebugAtThisLevel | ( | Upnp_LogLevel | DLevel, |
Dbg_Module | Module | ||
) |
Returns true if debug output should be done in this module.
[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. |
References DebugAtThisLevel().
Referenced by DebugAtThisLevel(), UpnpGetDebugFile(), and UpnpPrintf().
void PrintThreadPoolStats | ( | ThreadPool * | tp, |
const char * | DbgFileName, | ||
int | DbgLineNo, | ||
const char * | msg | ||
) |
Prints thread pool statistics.
[in] | tp | The thread pool. |
[in] | DbgFileName | The file name that called this function, use the macro __FILE__. |
[in] | DbgLineNo | The line number that the function was called, use the macro __LINE__. |
[in] | msg | The message. |
References PrintThreadPoolStats(), and UpnpPrintf().
Referenced by PrintThreadPoolStats(), and UpnpFinish().
void UpnpCloseLog | ( | void | ) |
void UpnpDisplayBanner | ( | FILE * | fd, |
const char ** | lines, | ||
size_t | size, | ||
int | starlength | ||
) |
Writes the buffer in the file as per the requested banner.
[in] | fd | file descriptor where the banner will be written. |
[in] | lines | The buffer that will be written. |
[in] | size | Size of the buffer. |
[in] | starlength | This parameter provides the width of the banner. |
void UpnpDisplayFileAndLine | ( | FILE * | fd, |
const char * | DbgFileName, | ||
int | DbgLineNo | ||
) |
Writes the file name and file number from where debug statement is coming to the log file.
[in] | fd | File descriptor where line number and file name will be written. |
[in] | DbgFileName | Name of the file. |
[in] | DbgLineNo | Line number of the file. |
References UpnpDisplayFileAndLine().
Referenced by UpnpDisplayFileAndLine(), and UpnpPrintf().
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] | level | 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. |
References DebugAtThisLevel(), and UpnpGetDebugFile().
Referenced by UpnpGetDebugFile().
int UpnpInitLog | ( | void | ) |
Initialize the log files.
References UPNP_E_SUCCESS, and UpnpInitLog().
Referenced by UpnpInitLog(), and 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. |
References DebugAtThisLevel(), UpnpDisplayFileAndLine(), and UpnpPrintf().
Referenced by AllocGenaHeaders(), FreeHandle(), gena_process_subscription_renewal_request(), gena_process_subscription_request(), GenaAutoRenewSubscription(), genaInitNotify(), genaInitNotifyExt(), genaNotifyAll(), genaNotifyAllExt(), genaRenewSubscription(), genaSubscribe(), genaUnregisterDevice(), get_miniserver_stopsock(), get_port(), GetHandleInfo(), getlocalhostname(), notify_send_and_recv(), PrintHandleInfo(), printService(), printServiceList(), printServiceTable(), PrintThreadPoolStats(), remove_dots(), RunMiniServer(), StopMiniServer(), UpnpAcceptSubscription(), UpnpAcceptSubscriptionExt(), UpnpDownloadXmlDoc(), UpnpFinish(), UpnpGetIfInfo(), UpnpGetServiceVarStatus(), UpnpGetServiceVarStatusAsync(), UpnpInit(), UpnpInit2(), UpnpInitPreamble(), UpnpInitStartServers(), UpnpNotify(), UpnpNotifyExt(), UpnpPrintf(), UpnpRegisterClient(), UpnpRegisterRootDevice(), UpnpRegisterRootDevice2(), UpnpRegisterRootDevice3(), UpnpRenewSubscription(), UpnpRenewSubscriptionAsync(), UpnpSearchAsync(), UpnpSendAction(), UpnpSendActionAsync(), UpnpSendActionEx(), UpnpSendActionExAsync(), UpnpSendAdvertisement(), UpnpSetMaxSubscriptions(), UpnpSetMaxSubscriptionTimeOut(), UpnpSubscribe(), UpnpSubscribeAsync(), UpnpThreadDistribution(), UpnpUnRegisterClient(), UpnpUnRegisterRootDevice(), UpnpUnSubscribe(), and UpnpUnSubscribeAsync().
void UpnpSetLogFileNames | ( | const char * | ErrFileName, |
const char * | InfoFileName | ||
) |
Set the name for error and information files, respectively.
[in] | ErrFileName | Name of the error file. |
[in] | InfoFileName | Name of the information file. |
References UpnpSetLogFileNames().
Referenced by UpnpSetLogFileNames().
void UpnpSetLogLevel | ( | Upnp_LogLevel | log_level | ) |
Set the log level (see Upnp_LogLevel
).
[in] | log_level | Log level. |
References UpnpSetLogLevel().
Referenced by UpnpSetLogLevel().