Use Pantheios logging framework from a dll

前端 未结 2 1092
死守一世寂寞
死守一世寂寞 2021-01-01 05:41

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).

2条回答
  •  一整个雨季
    2021-01-01 05:54

    AFAICT, your codes looks complete and correct, but it's hard to know how you're using it, and from where, and when exactly you get the exception. I think you should provide more information.

    One thing I woul d say: you might want to use Pantheios's internal logging "bailout" functionality - a log for the log, I suppose. So, your

    fprintf(stderr, "Failed to initialise the Pantheios libraries: %s\n",
        pantheios::pantheios_getInitErrorString(panres));
    

    would be better written as

    pantheios::util::onBailOut(pantheios::emergency,
        "Failed to initialise the Pantheios libraries",
        PANTHEIOS_FE_PROCESS_IDENTITY,
        pantheios::getInitErrorString(panres));
    

    That way your log-initialization failure will itself be logged.

提交回复
热议问题