File: Main.cpp

package info (click to toggle)
plog 1.1.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,404 kB
  • sloc: cpp: 13,637; ansic: 473; sh: 24; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 848 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//
// SkipNativeEOL - shows how to skip NativeEOLConverter.
//

#include <plog/Log.h>
#include <plog/Init.h>
#include <plog/Converters/UTF8Converter.h>
#include <plog/Formatters/TxtFormatter.h>
#include <plog/Appenders/RollingFileAppender.h>

int main()
{
    // NativeEOLConverter will use <CRLF> on Windows and <LF> on everything else as line endings.
    // It's used by default.
    // If you want to always use <LF> you can skip NativeEOLConverter and specify UTF8Converter directly.
    static plog::RollingFileAppender<plog::TxtFormatter, plog::UTF8Converter> fileAppender("SkipNativeEOL.log", 8000, 3); // Create an appender without NativeEOLConverter.
    plog::init(plog::debug, &fileAppender); // Initialize the logger.

    // Write some data.
    for (int i = 0; i < 100; ++i)
    {
        PLOGI << "i: " << i;
    }

    return 0;
}