pantheios

Connect Pantheios logging in a DLL to the main application's logging

六眼飞鱼酱① 提交于 2020-01-15 07:30:38
问题 Here's the situation: I'm working on a MFC application and want to integrate some logging capabilities into it. I did some research and settled on Pantheios since it seems to be regarded as the best logging API out there. I had no problems getting simple logging up and running - I even threw in some callback stuff to change the formatting of the output. My application will be making use of several DLLs. These are DLLs that I am actively developing and would like to integrate logging into them

Use Pantheios logging framework from a dll

≡放荡痞女 提交于 2019-12-18 13:39:14
问题 Im a trying to use pantheios logging framework from inside a c++ dll. I have successfully built the dll and it executes through my test application (C++ MFC Application). I have used implicit linking with the following includes: #include <pantheios/implicit_link/core.h> #include <pantheios/implicit_link/fe.simple.h> #include <pantheios/implicit_link/be.console.h> My DllMain initializes pantheios with the following calls: extern "C" const char PANTHEIOS_FE_PROCESS_IDENTITY[] =

Problem using pantheios file stock back end

倖福魔咒の 提交于 2019-12-12 23:30:06
问题 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 write to extenal file

喜你入骨 提交于 2019-12-11 14:58:20
问题 I looked around and I couldn't find the answer to how exactly to do this. I am trying to use Pantheios for logging and I want to write to an external file (otherwise whats the point). I am following one of the examples provided but It doesn't seem to be making the log file anywhere. Here is the code: Edit: Also pantheios_be_file_setFilePath is returning -4 (PANTHEIOS_INIT_RC_UNSPECIFIED_FAILURE) so thats.....not helpful #include "stdafx.h" #include <pantheios/pantheios.hpp> #include

How to make use of existing operator<< overloads when logging with Pantheios?

泄露秘密 提交于 2019-12-08 19:09:29
If have a ton of user defined types which implement operator<< to write to an std::ostream . How can I uses these when logging my types with Pantheios? Well there is a way you can reuse the operator<< but it ain't pretty. I personally use the boost::lexical_cast library to convert almost any data-type to the std::string data type, which Pantheios supports natively. So if you have the operator<< defined for the point class then you could simply type: pantheios::log_ERROR("Point: ", boost::lexical_cast<string>(point_object)) There are some caveats with this of course. Many people complain that

How to make use of existing operator<< overloads when logging with Pantheios?

本小妞迷上赌 提交于 2019-12-08 06:02:18
问题 If have a ton of user defined types which implement operator<< to write to an std::ostream . How can I uses these when logging my types with Pantheios? 回答1: Well there is a way you can reuse the operator<< but it ain't pretty. I personally use the boost::lexical_cast library to convert almost any data-type to the std::string data type, which Pantheios supports natively. So if you have the operator<< defined for the point class then you could simply type: pantheios::log_ERROR("Point: ", boost:

Beginner: How to use the Pantheios logging API library as a replacement for #ifdef DEBUG? How to def SEVLEVEL?

和自甴很熟 提交于 2019-12-06 06:29:05
问题 i want to log a lot of events in a dynamically search-algorithm (e.g. information about convergence to global optimum). This logging should have a switch to turn it off/on. Now there are a lot of possibilities to achieve that: implement a log-version and a non-log-version of the algorithm -> redundancy use macros -> ugly and not that safe use a c++ logging library (or: use 1% of the functional range of a logging library). I decided to use Pantheios , especially because of the performance