API for Initializing, configuring, and shutdown the logging facility.
More...
|
#define | SFLOG_INIT SFLOG_INITW |
| An alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant.
|
|
|
int __stdcall | SFLOG_INITW (LPCWSTR szAppName, LPCWSTR szLogDir, DWORD dwBackupFiles, size_t ulMaxFileSize, unsigned int *pClientToken) |
| Initialize the logging system and accepts a unicode filename and path.
|
|
int __stdcall | SFLOG_INITA (LPCSTR szAppName, LPCSTR szLogDir, DWORD dwBackupFiles, size_t ulMaxFileSize, unsigned int *pClientToken) |
| Initialize the logging system for SDK using ascii strings for the logging base filename and directory.
|
|
int __stdcall | SFLOG_SHUTDOWN (unsigned int uClientToken) |
| write all the cache logs to the file and closed the log file.
|
|
int __stdcall | SFLOG_GETLEVEL (unsigned int *nLevel) |
| query and retrieve the current logging level in the logging subsystem
|
|
int __stdcall | SFLOG_SETLEVEL (unsigned int uClientToken, unsigned int nLevel) |
| sets the current logging level in the logging subsystem
|
|
The NumXL SDK logging subsystem definie a logging level to determine whether a message is written to the log file or not. The numeric integer value of the logging level is represented by the value of one of those macros.
◆ SFLOG_INIT
◆ SFLOG_GETLEVEL()
int __stdcall SFLOG_GETLEVEL |
( |
unsigned int * | nLevel | ) |
|
retieve the current logging level (or threshold) in the logging system.
- Parameters
-
[out] | nLevel | (Required) a pointer to variable that the currently-selected logging level (e.g. debug, info, trace). For a full list, see Logging Levels |
- Returns
- status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
- Return values
-
- Requirements
Requirement | Value |
Target Platform | Windows |
Header | SFLOG.h (include Windows.h) |
Library | SFLOG.lib |
DLL | SFLOG.dll |
- See also
-
◆ SFLOG_INITA()
int __stdcall SFLOG_INITA |
( |
LPCSTR | szAppName, |
|
|
LPCSTR | szLogDir, |
|
|
DWORD | dwBackupFiles, |
|
|
size_t | ulMaxFileSize, |
|
|
unsigned int * | pClientToken ) |
Initialize the logging system for SDK using ascii strings for the logging base filename and directory.
- Parameters
-
[in] | szAppName | (Required) Is the application name (user-defined), but must match the configuration base filename |
[in] | szLogDir | (Optional) Is the full (absolute) path of the log file directory. If missing (i.e. NULL), SFLOG_Init uses the default temp directory in the current user's profile |
[in] | dwBackupFiles | (Required) Is the number of backup log files to keep, before we overwite the oldest one |
[in] | ulMaxFileSize | (Required) Is the maximym file size, before a rolling a new file starts (in bytes) |
[out] | pClientToken | An integer token used during the logging shutdown |
- Returns
- status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
- Return values
-
- Requirements
Requirement | Value |
Target Platform | Windows |
Header | SFLOG.h (include Windows.h) |
Library | SFLOG.lib |
DLL | SFLOG.dll |
- See also
-
<
- Examples
- log_ascii.cpp.
◆ SFLOG_INITW()
int __stdcall SFLOG_INITW |
( |
LPCWSTR | szAppName, |
|
|
LPCWSTR | szLogDir, |
|
|
DWORD | dwBackupFiles, |
|
|
size_t | ulMaxFileSize, |
|
|
unsigned int * | pClientToken ) |
Initializes the logging facility of the NumXL SDK using Unicode strings for the logging base filename and directory.
- Parameters
-
[in] | szAppName | (Required) Is the application name (user-defined), but must match the configuration base filename |
[in] | szLogDir | (Optional) Is the full (absolute) path of the log file directory. If missing (i.e. NULL), SFLOG_Init uses the default temp directory in the current user's profile |
[in] | dwBackupFiles | (Required) Is the number of backup log files to keep, before we overwrite the oldest one |
[in] | ulMaxFileSize | (Required) Is the maximym file size, before a rolling a new file starts (in bytes) |
[out] | pClientToken | an integer token used during the logging shutdown |
- Returns
- status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
- Return values
-
- A sample code
13unsigned int uClientToken=0;
14int nRetCode =
SFLOG_INITW(L
"testapp",L
"C:\\temp", 7, (3*1024*1024),&uClientToken);
16{
- Requirements
Requirement | Value |
Target Platform | Windows |
Header | SFLOG.h (include Windows.h) |
Library | SFLOG.lib |
DLL | SFLOG.dll |
- See also
-
- Examples
- log_init.cpp, and log_wchar.cpp.
◆ SFLOG_SETLEVEL()
int __stdcall SFLOG_SETLEVEL |
( |
unsigned int | uClientToken, |
|
|
unsigned int | nLevel ) |
set the new logging level in the SDK
- Parameters
-
[in] | uClientToken | (Required) Is the logging system token id (acquired during initialization). |
[in] | nLevel | (Required) Is the new logging level (e.g. debug, info, trace). For a full list, see Logging Levels |
- Returns
- status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
- Return values
-
- Requirements
Requirement | Value |
Target Platform | Windows |
Header | SFLOG.h (include Windows.h) |
Library | SFLOG.lib |
DLL | SFLOG.dll |
- See also
-
◆ SFLOG_SHUTDOWN()
int __stdcall SFLOG_SHUTDOWN |
( |
unsigned int | uClientToken | ) |
|
Shutdown and release resources allocated by logging system
- Parameters
-
[in] | uClientToken | (Required) Is the logging system token id (acquired during initialization). |
- Returns
- status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
- Return values
-
- Examples
std::wstring szAppName = L"testapp";
std::wstring szLogDir =L"C:\\temp";
DWORD dwBackupFiles=7;
size_t ulMaxFileSize= (1024 * 1024);
unsigned int uClientToken=0;
int nRetCode =
SFLOG_INITW(szAppName.c_str(),szLogDir.c_str(), dwBackupFiles, ulMaxFileSize, &uClientToken);
}
#define NDK_SUCCESS
SUCCESS return code.
Definition SFLOG.h:36
int __stdcall SFLOG_INITW(LPCWSTR szAppName, LPCWSTR szLogDir, DWORD dwBackupFiles, size_t ulMaxFileSize, unsigned int *pClientToken)
Initialize the logging system and accepts a unicode filename and path.
Definition SFLog.cpp:114
int __stdcall SFLOG_SHUTDOWN(unsigned int uClientToken)
write all the cache logs to the file and closed the log file.
Definition SFLog.cpp:286
- Requirements
Requirement | Value |
Target Platform | Windows |
Header | SFLOG.h (include Windows.h) |
Library | SFLOG.lib |
DLL | SFLOG.dll |
- See also
-
- Examples
- log_ascii.cpp, log_init.cpp, and log_wchar.cpp.