]>
vaikene.ee Git - evaf/blob - src/libs/Common/logger.cpp
2 * @file Common/logger.cpp
3 * @brief iLogger interface implementation
6 * Copyright (c) 2011 Enar Vaikene
8 * This file is part of the eVaf C++ cross-platform application development framework.
10 * This file can be used under the terms of the GNU General Public License
11 * version 3.0 as published by the Free Software Foundation and appearing in
12 * the file LICENSE included in the packaging of this file. Please review the
13 * the following information to ensure the GNU General Public License version
14 * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
21 #include "iregistry.h"
37 //-------------------------------------------------------------------
39 using namespace eVaf::Common
;
41 iLogger
* iLogger::instance()
43 static Internal::Logger singleton
;
48 //-------------------------------------------------------------------
50 using namespace eVaf::Common::Internal
;
52 void defFatalMsgHandler(QString
const & msg
, QString
const & source
, QString
const & where
)
56 fprintf(stderr
, "FATAL ERROR: %s (occurred in %s)\n", qPrintable(msg
), qPrintable(where
));
66 //-------------------------------------------------------------------
68 LoggerSource::LoggerSource()
70 , severity(iLogger::Fatal
)
75 LoggerSource::LoggerSource(LoggerSource
const & o
)
77 , severity(o
.severity
)
79 , maxCount(o
.maxCount
)
82 void LoggerSource::init(QString
const & source
, QString
const & logDir
, QString
const & etcDir
)
86 fileName
= logDir
+ source
+ ".log";
90 //-------------------------------------------------------------------