#include "ThreadPool.h"
#include "upnpconfig.h"
#include "UpnpGlobal.h"
#include <stdio.h>
Go to the source code of this file.
|
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 *ErrFileName, const char *InfoFileName) |
| Set the name for error and information files, respectively. More...
|
|
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. More...
|
|
int | DebugAtThisLevel (Upnp_LogLevel DLevel, Dbg_Module Module) |
| Returns true if debug output should be done in this module. More...
|
|
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...
|
|
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. More...
|
|
void | UpnpDisplayBanner (FILE *fd, const char **lines, size_t size, size_t starlength) |
| Writes the buffer in the file as per the requested banner. More...
|
|
|
The user has the option to select 4 different types of debugging levels, see UpnpSetLogLevel . The critical level will show only those messages which can halt the normal processing of the library, like memory allocation errors. The remaining three levels are just for debugging purposes. Packet level will display all the incoming and outgoing packets that are flowing between the control point and the device. Info Level displays the other important operational information regarding the working of the library. If the user selects All, then the library displays all the debugging information that it has.
UPNP_CRITICAL [0]
UPNP_PACKET [1]
UPNP_INFO [2]
UPNP_ALL [3]
|
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 |
|
◆ UPNP_DEFAULT_LOG_LEVEL
#define UPNP_DEFAULT_LOG_LEVEL UPNP_ALL |
Default log level : see Upnp_LogLevel
◆ DebugAtThisLevel()
int DebugAtThisLevel |
( |
Upnp_LogLevel |
DLevel, |
|
|
Dbg_Module |
Module |
|
) |
| |
Returns true if debug output should be done in this module.
- Returns
- Nonzero value if true, zero if false.
- Parameters
-
[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 g_log_level.
Referenced by UpnpPrintf().
◆ UpnpCloseLog()
void UpnpCloseLog |
( |
void |
| ) |
|
◆ UpnpDisplayBanner()
void UpnpDisplayBanner |
( |
FILE * |
fd, |
|
|
const char ** |
lines, |
|
|
size_t |
size, |
|
|
size_t |
starlength |
|
) |
| |
Writes the buffer in the file as per the requested banner.
- Parameters
-
[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. |
◆ UpnpDisplayFileAndLine()
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.
- Parameters
-
[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. |
◆ UpnpGetDebugFile()
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.
- Returns
- NULL if the module is turn off for debug otheriwse returns the right file descriptor.
- Parameters
-
[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. |
◆ UpnpInitLog()
Initialize the log files.
- Returns
- -1 if fails or UPNP_E_SUCCESS if succeeds.
Referenced by UpnpInitPreamble().
◆ UpnpPrintf()
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.
- Parameters
-
[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().
Referenced by FreeHandle(), gena_process_subscription_request(), get_port(), getlocalhostname(), http_MakeMessage(), notify_send_and_recv(), 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().
◆ UpnpSetLogFileNames()
void UpnpSetLogFileNames |
( |
const char * |
ErrFileName, |
|
|
const char * |
InfoFileName |
|
) |
| |
Set the name for error and information files, respectively.
- Parameters
-
[in] | ErrFileName | Name of the error file. |
[in] | InfoFileName | Name of the information file. |
References errFileName, and infoFileName.
◆ UpnpSetLogLevel()
void UpnpSetLogLevel |
( |
Upnp_LogLevel |
log_level | ) |
|
Set the log level (see Upnp_LogLevel
).
- Parameters
-
References g_log_level.