小编Dan*_*onk的帖子

在整个项目中使用Poco :: Logger

AutoPtr<SplitterChannel> splitterChannel(new SplitterChannel());

        AutoPtr<Channel> consoleChannel(new ConsoleChannel());
        AutoPtr<Channel> fileChannel(new FileChannel("Arcanite.log"));
        AutoPtr<FileChannel> rotatedFileChannel(new FileChannel("Arcanite_R.log"));

        rotatedFileChannel->setProperty("rotation", "100");
        rotatedFileChannel->setProperty("archive", "timestamp");

        splitterChannel->addChannel(consoleChannel);
        splitterChannel->addChannel(fileChannel);
        splitterChannel->addChannel(rotatedFileChannel);

        //"%d-%m-%Y %H:%M:%S: %t"
        AutoPtr<Formatter> formatter(new PatternFormatter("%d-%m-%Y %H:%M:%S %s: %t"));
        AutoPtr<Channel> formattingChannel(new FormattingChannel(formatter, splitterChannel));


        Logger& sLog = Logger::create("LogChan", formattingChannel, Message::PRIO_TRACE);
Run Code Online (Sandbox Code Playgroud)

我已经在多个类中编写了我想用于服务器的记录器。我该如何适应这一点?这可能是基本的C ++,但我似乎错过了几节课:P

c++ logging poco-libraries

3
推荐指数
1
解决办法
4525
查看次数

标签 统计

c++ ×1

logging ×1

poco-libraries ×1