CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
logging_internal.h
Go to the documentation of this file.
1 
5 // Internal use, include only logging.h!
6 
7 #ifndef CVMFS_LOGGING_INTERNAL_H_
8 #define CVMFS_LOGGING_INTERNAL_H_
9 
10 #include <cstdarg>
11 #include <string>
12 
13 #ifdef CVMFS_NAMESPACE_GUARD
14 namespace CVMFS_NAMESPACE_GUARD {
15 #endif
16 
18  kLogDebug = 0x01,
19  kLogStdout = 0x02,
20  kLogStderr = 0x04,
21  kLogSyslog = 0x08,
23  kLogSyslogErr = 0x20,
24  kLogCustom0 = 0x40,
25  kLogCustom1 = 0x80,
26  kLogCustom2 = 0x100,
27 };
28 
48  static void Set(LogFacilities info, LogFacilities error);
49 
50  static LogFacilities info; // default kLogStdout
51  static LogFacilities error; // default kLogStderr
52 };
53 
54 enum LogFlags {
55  kLogNoLinebreak = 0x200,
56  kLogShowSource = 0x400,
57 };
58 
59 enum LogLevels {
60  kLogLevel0 = 0x800,
61  kLogVerbose = 0x1000,
62  kLogNormal = 0x2000,
63  kLogDiscrete = 0x4000,
64  kLogNone = 0x8000,
65 };
66 
71 enum LogSource {
72  kLogCache = 1,
105 };
106 
109 
110 void SetLogSyslogLevel(const int level);
111 int GetLogSyslogLevel();
112 void SetLogSyslogFacility(const int facility);
114 void SetLogCustomFile(unsigned id, const std::string &filename);
115 void SetLogMicroSyslog(const std::string &filename);
116 std::string GetLogMicroSyslog();
117 void SetLogSyslogPrefix(const std::string &prefix);
118 void SetLogSyslogShowPID(bool flag);
119 void SetLogVerbosity(const LogLevels min_level);
120 void LogShutdown();
121 
122 #ifdef DEBUGMSG
123 void SetLogDebugFile(const std::string &filename);
124 std::string GetLogDebugFile();
125 #else
126 #define SetLogDebugFile(filename) ((void)0)
127 #define GetLogDebugFile() (std::string(""))
128 #endif
129 
130 void SetAltLogFunc(void (*fn)(const LogSource source, const int mask,
131  const char *msg));
132 
133 #ifdef CVMFS_NAMESPACE_GUARD
134 } // namespace CVMFS_NAMESPACE_GUARD
135 #endif
136 
137 #endif // CVMFS_LOGGING_INTERNAL_H_
void SetLogSyslogFacility(const int local_facility)
Definition: logging.cc:129
void SetLogSyslogLevel(const int level)
Definition: logging.cc:97
void SetLogSyslogShowPID(bool flag)
Definition: logging.cc:200
const int kLogWarning
LogFlags
void SetAltLogFunc(void(*fn)(const LogSource source, const int mask, const char *msg))
Definition: logging.cc:350
void SetLogMicroSyslog(const std::string &filename)
Definition: logging.cc:214
#define SetLogDebugFile(filename)
int GetLogSyslogLevel()
Definition: logging.cc:114
#define GetLogDebugFile()
LogSource
void SetLogVerbosity(const LogLevels min_level)
Definition: logging.cc:207
void SetLogCustomFile(unsigned id, const std::string &filename)
Definition: logging.cc:477
std::string GetLogMicroSyslog()
Definition: logging.cc:250
LogLevels
void LogShutdown()
Definition: logging.cc:528
LogFacilities
const int kLogVerboseMsg
void SetLogSyslogPrefix(const std::string &prefix)
Definition: logging.cc:187
static LogFacilities info
static LogFacilities error
int GetLogSyslogFacility()
Definition: logging.cc:160