This is an example program how to use the multi-byte (wide) chanraterset version of the SFLOG functions. More details about this example.
#include <windows.h>
#include <iostream>
#include <string>
#include "SFLOG.h"
int main(){
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);
std::wcout << L" SUCCESS - Logging system is initialized .." << std::endl;
std::wstring szErrorMsg(L"Test message");
std::wcout << L" Shutting down the Logging system ..." << std::endl;
}
return 0;
}
#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
#define SFLOG_MSG_ERROR_W(msg)
Helper macro for logging wide-character (unicode) message at error level.
Definition SFLOG.h:139
#define SFLOG_ERROR
Enable error level logging: error and fatal error messages.
Definition SFLOG.h:22
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.
Definition SFLog.cpp:492