Engauge Digitizer 2
Loading...
Searching...
No Matches
Logger.cpp
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#include <log4cpp/Category.hh>
10#include "Logger.h"
12#include <QString>
13
15
18
19using namespace log4cpp;
20
22 const QString &filename,
23 bool isDebug)
24{
25 LayoutAppender *appender = nullptr;
26
27 const size_t MAX_FILE_SIZE_BYTES = 6 * 1024 * 1024; // Size that should satisfy most email servers
28 const unsigned int MAX_BACKUP_INDEX = 2;
29 const bool APPEND_TO_PREVIOUS_FILE = false;
30
31 // Log to file for development
32 appender = dynamic_cast<LayoutAppender*> (new RollingFileAppender (name.toStdString (),
33 filename.toStdString (),
37
39 // With date: %d{%H:%M:%S.%l} %-5p %c - %m%n
40 // Without date: %-5p %c - %m%n
41 layout->setConversionPattern ("%-5p %c - %m%n");
42 appender->setLayout (layout);
43
45
46 // Levels are EMERG, FATAL, ALERT, CRIT, ERROR, WARN, NOTICE, INFO, DEBUG.
47 //
48 // Most trace logging is at INFO level, but methods that are called extremely often (like mouse
49 // moves and status bar updates) are at the lower DEBUG level so they are rarely seen
50 if (isDebug) {
52 } else {
54 }
55
57}
const int INNER_RADIUS_MIN
log4cpp::Category * mainCat
Definition Logger.cpp:14
void initializeLogging(const QString &name, const QString &filename, bool isDebug)
Definition Logger.cpp:21
const QString INDENTATION_DELTA
const QString INDENTATION_PAST_TIMESTAMP
Noop class that mimics class of the same name in log4cpp library.
Definition Category.hh:15
static Category & getRoot()
Noop method to get root.
Definition Category.cpp:24
void setPriority(Priority::Value priority)
Noop method to set priority.
Definition Category.cpp:38
void addAppender(Appender *appender)
Noop method to add an Appender.
Definition Category.cpp:15
Noop class that mimics the same class in the log4cpp library.
Noop class that mimics the same class in the log4cpp library.
Noop class that mimics the same class in the log4cpp library.