Как записать с помощью pantheios в файл?

Я пробовал использовать пример из pantheios для записи в файл, но не смог заставить его работать. Сообщения правильно отображаются в консоли, но файл журнала не создается. Я попытался изменить уровни серьезности, так как увидел этот поток , но никто не работает.

Вот код:

/* Pantheios Header Files */
#include             // Pantheios C++ main header
#include        // for pantheios::args
#include   // for pantheios::exception

#include       // be.file header

/* Standard C/C++ Header Files */
#include                           // for std::exception
#include                                 // for std::bad_alloc
#include                              // for std::string
#include                            // for exit codes

/* ////////////////////////////////////////////////////////////////////// */

/* Define the stock front-end process identity, so that it links when using
* fe.N, fe.simple, etc. */
PANTHEIOS_EXTERN_C const PAN_CHAR_T PANTHEIOS_FE_PROCESS_IDENTITY[] = PANTHEIOS_LITERAL_STRING("example.cpp.file");

/* ////////////////////////////////////////////////////////////////////// */

#define PSTR(x)         PANTHEIOS_LITERAL_STRING(x)

/* ////////////////////////////////////////////////////////////////////// */

int main(int argc, char **argv)
{
    try
    {
#ifndef PANTHEIOS_USE_WIDE_STRINGS
        pantheios::log_DEBUG("main(", pantheios::args(argc, argv), ")");
#else /* ? !PANTHEIOS_USE_WIDE_STRINGS */
        STLSOFT_SUPPRESS_UNUSED(argc); STLSOFT_SUPPRESS_UNUSED(argv);
#endif /* !PANTHEIOS_USE_WIDE_STRINGS */

        pantheios::log_NOTICE(PSTR("stmt 1"));

        // Set the file name for the local back-end, truncating the
        // file's existing contents, if any.
        pantheios_be_file_setFilePath(PSTR("log.local"),     PANTHEIOS_BE_FILE_F_TRUNCATE, PANTHEIOS_BE_FILE_F_TRUNCATE, PANTHEIOS_BEID_LOCAL);

        pantheios::log_NOTICE(PSTR("stmt 2"));

        // Set the file name for the remote back-end.
        pantheios_be_file_setFilePath(PSTR("log.remote"), PANTHEIOS_BEID_REMOTE);

        pantheios::log_NOTICE(PSTR("stmt 3"));

        // Set the file name for all back-ends.
        pantheios_be_file_setFilePath(PSTR("log.all"));

    pantheios::log_NOTICE(PSTR("stmt 4"));

    pantheios::log_DEBUG(PSTR("exiting main()"));

    system("pause");
    return EXIT_SUCCESS;
}
catch(std::bad_alloc&)
{
    pantheios::log(pantheios::alert, PSTR("out of memory"));
}
catch(std::exception& x)
{
    pantheios::log_CRITICAL(PSTR("Exception: "), pantheios::exception(x));
}
catch(...)
{
    pantheios::logputs(pantheios::emergency, PSTR("Unexpected unknown error"));
}

return EXIT_FAILURE;
}

/* ///////////////////////////// end of file //////////////////////////// */

У меня есть файл "include_pantheios.cpp" для неявной ссылки. Вот оно:

/* Pantheios Header Files */
#include 
#include 
#include 
#include 

#if (   defined(UNIX) || \
    defined(unix))&& \
    (   defined(_WIN32) || \
    defined(_WIN64))
# include 
#endif /* _WIN32 || _WIN64 */

Кто-нибудь видит, откуда у меня проблема? Заранее спасибо,

Винсент

5
задан Community 23 May 2017 в 11:57
поделиться