Don't allow to unrecord past the branch point
[vng.git] / Logger.h
blob824a901af40b5aaec49da6eece8086cc507d305d
1 /*
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/>.
19 #ifndef Logger_H
20 #define Logger_H
22 #include <QTextStream>
24 class LoggerPrivate;
26 class Logger {
27 public:
28 enum Verbosity {
29 Quiet,
30 Chatty,
31 Verbose,
32 Debug
35 Logger();
37 /// return an outputstream logger irregardless of the loglevel
38 static QTextStream &standardOut();
39 /// return an outputstream or a dummy logger based on verbosity set on the logger and passed as argument.
40 static QTextStream &log(Verbosity verbosity);
41 /// equals log(Debug)
42 static QTextStream &debug();
43 /// equals log(Chatty)
44 static QTextStream &info();
45 /// equals log(Verbose)
46 static QTextStream &warn();
47 /// equals log(Quiet)
48 static QTextStream &error();
50 /**
51 * by calling this method all the logger operations will be routed via a pager like less (if available).
52 * @see stopPager()
54 static void startPager();
55 /**
56 * by calling this method all the logger operations will be routed via a pager like less (if available).
57 * @see stopPager()
59 static void stopPager();
60 /// return true when there is a pager in use that doesn't support throughput of color information.
61 static bool hasNonColorPager();
62 /// Set the verbosity of the logger. Already in use logger streams will not be affected.
63 static void setVerbosity(Verbosity verbosity);
64 /// return the verbosity set on the logger.
65 static Verbosity verbosity();
67 private:
68 LoggerPrivate * const d;
71 #endif