2 * This file is part of the vng project
3 * Copyright (C) 2008 Thomas Zander <tzander@trolltech.com>
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include <QTextStream>
27 * Logs any sort of information at configurable log levels.
41 /// return an outputstream logger irregardless of the loglevel
42 static QTextStream
&standardOut();
43 /// return an outputstream or a dummy logger based on verbosity set on the logger and passed as argument.
44 static QTextStream
&log(Verbosity verbosity
);
46 static QTextStream
&debug();
47 /// equals log(Chatty)
48 static QTextStream
&info();
49 /// equals log(Verbose)
50 static QTextStream
&warn();
52 static QTextStream
&error();
54 * in case a pager is used calling this will explicitly flush the output to the screen.
55 * You should not have to call this because the different Logger methods which return a QTextStream call it automatically.
57 static void flushPager();
60 * by calling this method all the logger operations will be routed via a pager like less (if available).
63 static void startPager();
65 * by calling this method all the logger operations will be routed via a pager like less (if available).
68 static void stopPager();
69 /// return true when there is a pager in use that doesn't support throughput of color information.
70 static bool hasNonColorPager();
71 /// Set the verbosity of the logger. Already in use logger streams will not be affected.
72 static void setVerbosity(Verbosity verbosity
);
73 /// return the verbosity set on the logger.
74 static Verbosity
verbosity();
77 LoggerPrivate
* const d
;