Make sure we don't ignore hidden files.
[vng.git] / src / Logger.h
blobbcdbc7d1e5f92f1c8372ca4a6b74b749ba6d1048
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 /**
27 * Logs any sort of information at configurable log levels.
29 class Logger
31 public:
32 enum Verbosity {
33 Quiet,
34 Chatty,
35 Verbose,
36 Debug
39 Logger();
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);
45 /// equals log(Debug)
46 static QTextStream &debug();
47 /// equals log(Chatty)
48 static QTextStream &info();
49 /// equals log(Verbose)
50 static QTextStream &warn();
51 /// equals log(Quiet)
52 static QTextStream &error();
53 /**
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();
59 /**
60 * by calling this method all the logger operations will be routed via a pager like less (if available).
61 * @see stopPager()
63 static void startPager();
64 /**
65 * by calling this method all the logger operations will be routed via a pager like less (if available).
66 * @see stopPager()
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();
76 private:
77 LoggerPrivate * const d;
80 #endif