Problem using pantheios file stock back end
Asked Answered
C

0

1

I am trying to use pantheios file stock back end to log from my dll in c++. The file gets created but nothing gets written to the file.
Here is a snippet of my code

if (pantheios::pantheios_init() < 0)
{    
   MessageBox(NULL, "Init Failed", "fvm", MB_OK);
}else {
   MessageBox(NULL, "Init Passed", "fvm", MB_OK);
   pantheios::log_INFORMATIONAL("Logger enabled!");
}

DWORD pid = GetCurrentProcessId();
sprintf_s(moduleName, sizeof(moduleName), "C:\\%d.log", pid);
pantheios_be_file_setFilePath(moduleName, PANTHEIOS_BE_FILE_F_TRUNCATE,PANTHEIOS_BE_FILE_F_TRUNCATE, PANTHEIOS_BEID_LOCAL);
pantheios::log(pantheios::debug, "Entering main");

I get the Init Passed message box but no log statements are dumped in the file.

Cordwainer answered 19/3, 2010 at 0:27 Comment(2)
While I don't know Pantheios, I noticed you are only doing low level logging (info and debug). Perhaps your configuration is not set to include that detail. Try logging with pantheios::log_EMERGENCY() (the highest level) and see if that shows up.Helgoland
Yes, that was indeed the problem. I had tested a demo code using the debug version of my dll and the logging at the default severity level worked fine but in the release build the default severity level is higher.Cordwainer

© 2022 - 2024 — McMap. All rights reserved.