NumXL SDK - Logging API
Message logging

API for writing the message to the log file. More...

Topics

 Helper Macros
 helper macros definitions for the SDK functions
 

Functions

int __stdcall SFLOG_LOGMSGW (int nLevel, LPCSTR szFilename, LPCSTR szFuncName, LPCSTR szFuncSig, int nLineNo, LPCWSTR szMsg)
 Log a wide-character (i.e., wchar_t*) message.
 
int __stdcall SFLOG_LOGMSGA (int nLevel, LPCSTR szFilename, LPCSTR szFuncName, LPCSTR szFuncSig, int nLineNo, LPCSTR szMsg)
 Log a narrow-character (i.e., ASCII) log message.
 

Detailed Description

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.

Function Documentation

◆ SFLOG_LOGMSGA()

int __stdcall SFLOG_LOGMSGA ( int nLevel,
LPCSTR szFilename,
LPCSTR szFuncName,
LPCSTR szFuncSig,
int nLineNo,
LPCSTR szMsg )
Parameters
[in]nLevel(Required) Is the logging level (e.g. debug, info, trace). For a full list, see Logging Levels
[in]szFilename(Required) Is the reference source filename
[in]szFuncName(Required) Is the reference function name for the log message
[in]szFuncSig(Required) Is the reference function signature (i.e., mangled name, if c++)
[in]nLineNo(Required) Is the reference line number in the source file.
[in]szMsg(Required) Is the logging message (ASCII or single-byte character)
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_FAILEDerror
See also
SFLOG_LOGMSGW, SFLOG_LOGMSG

Log a narrow-character (i.e., ASCII) message

Note
The SFLOG.h header defines SFLOG_LOGMSG as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant.
Remarks
  1. C/C++ compiler has a set of standard predefined preprocessors that can be used when calling this function:
    • __FILE__ : This macro expands to the name of the current input file
    • __LINE__ : This macro expands to the current input line number, in the form of a decimal integer constant
  2. Microsoft C/C++ compiler offers additional predefined macros that we can use when calling this function:
    • __FUNCTION__ : This macro expands to the the undecorated name of the enclosing function as a string literal
    • __FUNCSIG__ : This macro expands to the the signature of the enclosing function as a string literal.
  3. For convenience, you may wish to define few macros to automate the logging further. For example:
Requirements
Target Platform Windows
Header SFLOG.h (include Windows.h)
Library SFLOG.lib
DLL SFLOG.dll
Examples
log_ascii.cpp.

◆ SFLOG_LOGMSGW()

int __stdcall SFLOG_LOGMSGW ( int nLevel,
LPCSTR szFilename,
LPCSTR szFuncName,
LPCSTR szFuncSig,
int nLineNo,
LPCWSTR szMsg )
Parameters
[in]nLevel(Required) Is the logging level (e.g. debug, info, trace). For a full list, see Logging Levels
[in]szFilename(Required) Is the reference source filename
[in]szFuncName(Required) Is the reference function name for the log message
[in]szFuncSig(Required) Is the reference function signature (i.e., mangled name, if c++)
[in]nLineNo(Required) Is the reference line number in the source file.
[in]szMsg(Required) Is the logging message
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_FAILEDerror
NDK_UNINITIALIZEDerror
See also
SFLOG_LOGMSGA, SFLOG_LOGMSG

Log a wide-character (i.e., wchar_t*) message

Note
The SFLOG.h header defines SFLOG_LOGMSG as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant.
Remarks
  1. C/C++ compiler has a set of standard predefined preprocessors that can be used when calling this function:
    • __FILE__ : This macro expands to the name of the current input file
    • __LINE__ : This macro expands to the current input line number, in the form of a decimal integer constant
  2. Microsoft C/C++ compiler offers additional predefined macros that we can use when calling this function:
    • __FUNCTION__ : This macro expands to the the undecorated name of the enclosing function as a string literal
    • __FUNCSIG__ : This macro expands to the the signature of the enclosing function as a string literal.
  3. For convenience, you may wish to define few macros to automate the logging further. For example:
Requirements
Target Platform Windows
Header SFLOG.h (include Windows.h)
Library SFLOG.lib
DLL SFLOG.dll
Examples
log_wchar.cpp.