File: log.h

package info (click to toggle)
filtermail 1.06.00-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,688 kB
  • sloc: cpp: 2,487; fortran: 249; makefile: 106; ansic: 51; sh: 36
file content (40 lines) | stat: -rw-r--r-- 878 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef INCLUDED_LOG_
#define INCLUDED_LOG_

#include <iosfwd>
//#include <fstream>
#include <memory>

namespace FBB
{
    class SyslogBuf;
    class LogBuf;
}

class Log
{
    template <typename Type>
    friend Log &operator<<(Log &log, Type const &type);                 // .f

                                                            // opinsert1.cc
    friend Log &operator<<(Log &log, std::ios_base &(*func)(std::ios_base &));

                                                            // opinsert2.cc
    friend Log &operator<<(Log &log, std::ostream &(*func)(std::ostream &));

    std::ostream *d_outPtr;

    static std::unique_ptr<Log> s_logPtr;   // the singleton Log object

    public:
        static void initialize(std::ostream *outPtr);
        static Log &instance();
        
    private:
        Log(std::ostream *outPtr);
};

#include "log.f"

#endif