SFLOG_LogMsg

int __stdcall SFLOG_LogMsg(int nLevel,


LPCTSTR szFilename,


LPCTSTR szFuncName,


LPCTSTR szFuncSig,


int nLineNo,


LPCTSTR szMsg 

)

log a message into the logging system

Returns
status code of the operation
Return values
NDK_SUCCESS  Operation successful
NDK_FAILED  Operation unsuccessful. See Macros for full list.
Parameters
nLevellogging level (i.e. debug, info, trace, error, etc.).
Level  Macro  Description
1 SFLOG_TRACE  Trace level logging
2 SFLOG_DEBUG  Debug level logging
3 SFLOG_INFO  Information level logging
4 SFLOG_WARN  Warning level logging
5 SFLOG_ERROR  Error level logging
6 SFLOG_FATAL  Fatal or critical error logging
szFilenamethe source filename that triggers this logging message
szFuncNamethe function name from which this log is triggered from
szFuncSigthe function sugnature (i.e. mangled name)
nLineNoLine number in the source file
szMsgError message
Remarks
  • This function will fail, and return (NDK_LOG_UNINITIALIZED), if the logging system has not been initialized yet.
  • 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
  • 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
  • For convenience, you may wish to define few macros to automate the logging further. For example:
    #define LOG_INFO(x) \
    SFLOG_logMsg(SFLOG_INFO, __FILE__,__FUNCTION__,__FUNCSIG__,__LINE__,x);
    
    #define LOG_ERROR(x) \
    SFLOG_logMsg(SFLOG_ERROR, __FILE__,__FUNCTION__,__FUNCSIG__,__LINE__,x);
    
    #define LOG_WARN(x) \
    SFLOG_logMsg(SFLOG_ERROR, __FILE__,__FUNCTION__,__FUNCSIG__,__LINE__,x);


Requirements
Header SFLogger.H
Library SFLOG.LIB
DLL SFLOG.DLL
Examples
#define LOG_ERROR(x)SFLOG_logMsg(SFLOG_ERROR, __FILE__,__FUNCTION__,__FUNCSIG__,__LINE__,x)
....
nRet = NDK_SESMTH( ...);
if(nRet < NDK_SUCCESS){
LOG_ERROR("NDK_DESMTH failed!");

...
}
References
* Hamilton, J .D.; Time Series Analysis , Princeton University Press (1994), ISBN 0-691-04289-6
* Tsay, Ruey S.; Analysis of Financial Time Series John Wiley & SONS. (2005), ISBN 0-471-690740
* D. S.G. Pollock; Handbook of Time Series Analysis, Signal Processing, and Dynamics; Academic Press; Har/Cdr edition(Nov 17, 1999), ISBN: 125609906
* Box, Jenkins and Reisel; Time Series Analysis: Forecasting and Control; John Wiley & SONS.; 4th edition(Jun 30, 2008), ISBN: 470272848