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
|