]>
Commit | Line | Data |
---|---|---|
9f4a0c62 RC |
1 | /* |
2 | * Copyright (c) 2002, Robert Collins.. | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; either version 2 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * A copy of the GNU General Public License can be found at | |
10 | * http://www.gnu.org/ | |
11 | * | |
12 | * Written by Robert Collins <rbtcollins@hotmail.com> | |
13 | * | |
14 | */ | |
15 | ||
16 | #include "LogSingleton.h" | |
17 | ||
18 | // Logging class. Default logging level is PLAIN. | |
19 | class LogFile : public LogSingleton { | |
20 | public: | |
21 | LogFile(); | |
22 | void clearFiles(); // delete all target filenames | |
23 | void setFile (int minlevel, String const &path, bool append); | |
24 | /* Some platforms don't call destructors. So this call exists | |
25 | * which guarantees to flush any log data... | |
26 | * but doesn't call generic C++ destructors | |
27 | */ | |
28 | virtual void exit (int const exit_code) __attribute__ ((noreturn)); | |
29 | virtual ~LogFile(); | |
30 | // get a specific verbosity stream. | |
31 | virtual ostream &operator() (enum log_level level); | |
32 | ||
33 | protected: | |
34 | LogFile (LogFile const &); // no copy constructor | |
35 | LogFile &operator = (LogFile const&); // no assignment operator | |
36 | virtual void endEntry(); // the current in-progress entry is complete. | |
37 | private: | |
38 | void log_save (int babble, String const &filename, bool append); | |
39 | }; |