]> cygwin.com Git - cygwin-apps/setup.git/blob - LogFile.h
2002-11-10 Robert Collins <rbtcollins@hotmail.com>
[cygwin-apps/setup.git] / LogFile.h
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 #include <sstream>
18
19 // Logging class. Default logging level is PLAIN.
20 class LogFile : public LogSingleton {
21 public:
22 LogFile *createLogFile();
23 LogFile();
24 void clearFiles(); // delete all target filenames
25 void setFile (int minlevel, String const &path, bool append);
26 /* Some platforms don't call destructors. So this call exists
27 * which guarantees to flush any log data...
28 * but doesn't call generic C++ destructors
29 */
30 virtual void exit (int const exit_code) __attribute__ ((noreturn));
31 virtual ~LogFile();
32 // get a specific verbosity stream.
33 virtual std::ostream &operator() (enum log_level level);
34
35 protected:
36 LogFile(std::stringbuf *aStream);
37 LogFile (LogFile const &); // no copy constructor
38 LogFile &operator = (LogFile const&); // no assignment operator
39 virtual void endEntry(); // the current in-progress entry is complete.
40 private:
41 void log_save (int babble, String const &filename, bool append);
42 };
This page took 0.03727 seconds and 5 git commands to generate.