Logging 使用Pantheios日志库记录到windows事件

Logging 使用Pantheios日志库记录到windows事件,logging,pantheios,Logging,Pantheios,如何使用Pantheios将日志消息发送到windows事件日志 及 如果我使用Pantheious从多个进程执行此操作,它会是进程吗 安全吗?我要买克拉吗 使用be.WindowsEventLog 不,我不这么认为,就像您使用来自多个进程的事件日志一样 使用be.WindowsEventLog 不,我不这么认为,就像您使用来自多个进程的事件日志一样 您需要执行以下操作: 您需要链接be.WindowsEventLog。 在Windows上,可以通过隐式链接将#include添加到一个编译单元来

如何使用Pantheios将日志消息发送到windows事件日志

如果我使用Pantheious从多个进程执行此操作,它会是进程吗 安全吗?我要买克拉吗

  • 使用be.WindowsEventLog

  • 不,我不这么认为,就像您使用来自多个进程的事件日志一样

  • 使用be.WindowsEventLog

  • 不,我不这么认为,就像您使用来自多个进程的事件日志一样


  • 您需要执行以下操作:

  • 您需要链接be.WindowsEventLog。
    在Windows上,可以通过隐式链接将
    #include
    添加到一个编译单元来完成此操作

  • 此外,您还必须定义特定于应用程序的函数(如:注释中的小注释所述)这是一个特定于应用程序的函数

  • 例如,可以在pantheios文件夹\test\scratch\test.scratch.api\test.scratch.api.cpp中找到简单的实现:

    //  The following allows this to be used with the Windows EventLog back-end.
    PANTHEIOS_CALL(void) pantheios_be_WindowsEventLog_calcCategoryAndEventId(
        int                     /* backEndId */
    ,   int                     /* severity */
    ,   pantheios::uint16_t*    category 
    ,   pantheios::uint32_t*    eventId
    ) /* throw() */
    {
    
       // NOTE: A proper implementation would specify non-0 values here that
       // identify the requisite event identifier and category within the
       // associated message file(s).
    
       *eventId    =   0;
       *category   =   0;
    }
    

    有关
    类别
    事件ID
    的文档可分别在和上找到。

    您需要执行以下操作:

  • 您需要链接be.WindowsEventLog。
    在Windows上,可以通过隐式链接将
    #include
    添加到一个编译单元来完成此操作

  • 此外,您还必须定义特定于应用程序的函数(如:注释中的小注释所述)这是一个特定于应用程序的函数

  • 例如,可以在pantheios文件夹\test\scratch\test.scratch.api\test.scratch.api.cpp中找到简单的实现:

    //  The following allows this to be used with the Windows EventLog back-end.
    PANTHEIOS_CALL(void) pantheios_be_WindowsEventLog_calcCategoryAndEventId(
        int                     /* backEndId */
    ,   int                     /* severity */
    ,   pantheios::uint16_t*    category 
    ,   pantheios::uint32_t*    eventId
    ) /* throw() */
    {
    
       // NOTE: A proper implementation would specify non-0 values here that
       // identify the requisite event identifier and category within the
       // associated message file(s).
    
       *eventId    =   0;
       *category   =   0;
    }
    
    有关
    类别
    事件ID
    的文档可分别在和上找到