Note that there are some explanatory texts on larger screens.

plurals
  1. POPantheios logging in C++ DLL
    text
    copied!<p>Here is scenario:</p> <p>I have <code>testApp.cpp</code> that has <code>main</code> function. And this <code>testApp.cpp</code> uses <code>misc.dll</code> and <code>common.dll</code> library. </p> <p>I would like to create a log to file rather than to console.</p> <p>So in <code>testApp.cpp</code> <code>main()</code> function, I use the following:</p> <pre><code>pantheios::pantheios_init(); pantheios_be_file_setFilePath("mylogfile.log"); pantheios::log_NOTICE(" START TESTAPP"); // Call function from misc.dll and common.dll pantheios::log_NOTICE(" END TESTAPP "); pantheios_be_file_setFilePath(NULL); </code></pre> <p>This WILL create <code>mylogfile.log</code> file with content 'START TESTAPP'</p> <p>NOW THE PROBLEM:</p> <p>I would also like to adding logging from misc.dll and common.dll to <code>mylogfile.log</code>. In other words, if I add log in <code>testMiscfunction()</code> in misc.dll, I would like that log from <code>testMiscfunction()</code> to be written to mylogfile.log. And of course, same things with common.dll.</p> <p>Now here is sample of DLL Entry for misc.dll </p> <pre><code>#include "pantheios/pantheios.hpp" #include "pantheios/backends/bec.file.h" #include "pantheios/implicit_link/core.h" #include "pantheios/implicit_link/be.file.h" extern "C" const char PANTHEIOS_FE_PROCESS_IDENTITY[] = "MISC_DLL"; BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: pantheios::pantheios_init(); break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; case DLL_PROCESS_DETACH: pantheios::pantheios_uninit(); break; } return TRUE; } </code></pre> <p>So now in </p> <pre><code>testMiscFunction() { pantheios::log_NOTICE("I am testMiscFunction"); } </code></pre> <p>So "I am testMiscFunction" is not being written to mylogfile.txt Question is: Why? What need to be done. </p> <p>Thanks.... </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload