logger.h
1 /********************************************************************************
2  * FARSA Utilities Library *
3  * Copyright (C) 2007-2011 Gianluca Massera <emmegian@yahoo.it> *
4  * Stefano Nolfi <stefano.nolfi@istc.cnr.it> *
5  * Tomassino Ferrauto <tomassino.ferrauto@istc.cnr.it> *
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program; if not, write to the Free Software *
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
20  ********************************************************************************/
21 
22 #ifndef LOGGER_H
23 #define LOGGER_H
24 
25 #include "utilitiesconfig.h"
26 #include <QString>
27 
28 class QTextEdit;
29 
30 namespace farsa {
31 
52 class FARSA_UTIL_API Logger {
53 public:
54  enum LogLevel {
56  LogAll = 0,
62  Superquiet
63  };
64 
65 public:
69  static void info( QString msg );
73  static void warning( QString msg );
77  static void error( QString msg );
83  static void setLogFilename( QString logfile );
85  static void setQTextEdit( QTextEdit* textedit );
89  static void enableStdOut( bool enabled );
93  static void setLogLevel(LogLevel level);
98  static QString logLevelToString(LogLevel level);
103  static LogLevel stringToLogLevel(QString level);
104 private:
106  Logger();
108  ~Logger();
109 };
110 
111 } // end namespace farsa
112 
113 #endif
This file contains the common type defitions used on the whole framework.
Only errors are logged.
Definition: logger.h:60
A macro to deprecate functions.
Logger class provides methods for logging messages.
Definition: logger.h:52
Only warnings and errors are logged.
Definition: logger.h:58