CernVM-FS
2.10.0
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
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 <ctime>
12
#include <string>
13
#include <vector>
14
15
#ifdef CVMFS_NAMESPACE_GUARD
16
namespace
CVMFS_NAMESPACE_GUARD {
17
#endif
18
19
enum
LogFacilities
{
20
kLogDebug
= 0x01,
21
kLogStdout
= 0x02,
22
kLogStderr
= 0x04,
23
kLogSyslog
= 0x08,
24
kLogSyslogWarn
= 0x10,
25
kLogSyslogErr
= 0x20,
26
kLogCustom0
= 0x40,
27
kLogCustom1
= 0x80,
28
kLogCustom2
= 0x100,
29
};
30
46
struct
DefaultLogging
{
50
static
void
Set(
LogFacilities
info,
LogFacilities
error);
51
52
static
LogFacilities
info
;
// default kLogStdout
53
static
LogFacilities
error
;
// default kLogStderr
54
};
55
56
enum
LogFlags
{
57
kLogNoLinebreak
= 0x200,
58
kLogShowSource
= 0x400,
59
kLogSensitive
= 0x800,
60
};
61
62
enum
LogLevels
{
63
kLogLevel0
= 0x01000,
64
kLogNormal
= 0x02000,
65
kLogInform
= 0x04000,
66
kLogVerbose
= 0x08000,
67
kLogNone
= 0x10000,
68
};
69
74
enum
LogSource
{
75
kLogCache
= 1,
76
kLogCatalog
,
77
kLogSql
,
78
kLogCvmfs
,
79
kLogHash
,
80
kLogDownload
,
81
kLogCompress
,
82
kLogQuota
,
83
kLogTalk
,
84
kLogMonitor
,
85
kLogLru
,
86
kLogFuse
,
87
kLogSignature
,
88
kLogFsTraversal
,
89
kLogCatalogTraversal
,
90
kLogNfsMaps
,
91
kLogPublish
,
92
kLogSpooler
,
93
kLogConcurrency
,
94
kLogUtility
,
95
kLogGlueBuffer
,
96
kLogHistory
,
97
kLogUnionFs
,
98
kLogPathspec
,
99
kLogReceiver
,
100
kLogUploadS3
,
101
kLogUploadGateway
,
102
kLogS3Fanout
,
103
kLogGc
,
104
kLogDns
,
105
kLogAuthz
,
106
kLogReflog
,
107
kLogKvStore
,
108
};
109
110
const
int
kLogWarning
=
kLogStdout
|
kLogShowSource
|
kLogNormal
;
111
const
int
kLogInfoMsg
=
kLogStdout
|
kLogShowSource
|
kLogInform
;
112
const
int
kLogVerboseMsg
=
kLogStdout
|
kLogShowSource
|
kLogVerbose
;
113
114
struct
LogBufferEntry
{
115
LogBufferEntry
(
LogSource
s,
int
m,
const
std::string &msg)
116
: timestamp(time(NULL)), source(s), mask(m), message(msg) { }
117
118
time_t
timestamp
;
119
LogSource
source
;
120
int
mask
;
121
std::string
message
;
122
};
123
124
void
SetLogSyslogLevel
(
const
int
level);
125
int
GetLogSyslogLevel
();
126
void
SetLogSyslogFacility
(
const
int
facility);
127
int
GetLogSyslogFacility
();
128
void
SetLogCustomFile
(
unsigned
id
,
const
std::string &filename);
129
void
SetLogMicroSyslog
(
const
std::string &filename);
130
std::string
GetLogMicroSyslog
();
131
void
SetLogSyslogPrefix
(
const
std::string &prefix);
132
void
SetLogSyslogShowPID
(
bool
flag);
133
void
SetLogVerbosity
(
const
LogLevels
max_level);
134
void
LogShutdown
();
135
136
#ifdef DEBUGMSG
137
void
SetLogDebugFile
(
const
std::string &filename);
138
std::string
GetLogDebugFile
();
139
#else
140
#define SetLogDebugFile(filename) ((void)0)
141
#define GetLogDebugFile() (std::string(""))
142
#endif
143
144
void
SetAltLogFunc
(
void
(*fn)(
const
LogSource
source,
const
int
mask,
145
const
char
*msg));
146
147
std::vector<LogBufferEntry>
GetLogBuffer
();
148
void
ClearLogBuffer
();
149
150
#ifdef CVMFS_NAMESPACE_GUARD
151
}
// namespace CVMFS_NAMESPACE_GUARD
152
#endif
153
154
#endif // CVMFS_LOGGING_INTERNAL_H_
GetLogBuffer
std::vector< LogBufferEntry > GetLogBuffer()
Definition:
logging.cc:524
SetLogSyslogFacility
void SetLogSyslogFacility(const int local_facility)
Definition:
logging.cc:182
SetLogVerbosity
void SetLogVerbosity(const LogLevels max_level)
Definition:
logging.cc:260
SetLogSyslogLevel
void SetLogSyslogLevel(const int level)
Definition:
logging.cc:150
kLogLru
Definition:
logging_internal.h:85
kLogHash
Definition:
logging_internal.h:79
kLogKvStore
Definition:
logging_internal.h:107
kLogSyslogErr
Definition:
logging_internal.h:25
kLogUploadS3
Definition:
logging_internal.h:100
kLogUtility
Definition:
logging_internal.h:94
LogBufferEntry::source
LogSource source
Definition:
logging_internal.h:119
SetLogSyslogShowPID
void SetLogSyslogShowPID(bool flag)
Definition:
logging.cc:253
LogBufferEntry::timestamp
time_t timestamp
Definition:
logging_internal.h:118
kLogPublish
Definition:
logging_internal.h:91
kLogWarning
const int kLogWarning
Definition:
logging_internal.h:110
LogFlags
LogFlags
Definition:
logging_internal.h:56
kLogDebug
Definition:
logging_internal.h:20
kLogGc
Definition:
logging_internal.h:103
kLogTalk
Definition:
logging_internal.h:83
kLogSignature
Definition:
logging_internal.h:87
kLogConcurrency
Definition:
logging_internal.h:93
LogBufferEntry::mask
int mask
Definition:
logging_internal.h:120
kLogCatalogTraversal
Definition:
logging_internal.h:89
kLogNoLinebreak
Definition:
logging_internal.h:57
SetAltLogFunc
void SetAltLogFunc(void(*fn)(const LogSource source, const int mask, const char *msg))
Definition:
logging.cc:403
kLogFsTraversal
Definition:
logging_internal.h:88
SetLogMicroSyslog
void SetLogMicroSyslog(const std::string &filename)
Definition:
logging.cc:267
kLogShowSource
Definition:
logging_internal.h:58
SetLogDebugFile
#define SetLogDebugFile(filename)
Definition:
logging_internal.h:140
kLogReflog
Definition:
logging_internal.h:106
kLogDownload
Definition:
logging_internal.h:80
kLogStdout
Definition:
logging_internal.h:21
kLogStderr
Definition:
logging_internal.h:22
GetLogSyslogLevel
int GetLogSyslogLevel()
Definition:
logging.cc:167
kLogSyslogWarn
Definition:
logging_internal.h:24
GetLogDebugFile
#define GetLogDebugFile()
Definition:
logging_internal.h:141
kLogCatalog
Definition:
logging_internal.h:76
DefaultLogging
Definition:
logging_internal.h:46
kLogGlueBuffer
Definition:
logging_internal.h:95
kLogSensitive
Don't add the line to the memory log buffer.
Definition:
logging_internal.h:59
kLogUnionFs
Definition:
logging_internal.h:97
kLogInform
Definition:
logging_internal.h:65
kLogCustom2
Definition:
logging_internal.h:28
kLogS3Fanout
Definition:
logging_internal.h:102
kLogPathspec
Definition:
logging_internal.h:98
kLogReceiver
Definition:
logging_internal.h:99
LogSource
LogSource
Definition:
logging_internal.h:74
kLogAuthz
Definition:
logging_internal.h:105
SetLogCustomFile
void SetLogCustomFile(unsigned id, const std::string &filename)
Definition:
logging.cc:544
kLogSyslog
Definition:
logging_internal.h:23
kLogCache
Definition:
logging_internal.h:75
kLogSql
Definition:
logging_internal.h:77
GetLogMicroSyslog
std::string GetLogMicroSyslog()
Definition:
logging.cc:303
kLogCustom0
Definition:
logging_internal.h:26
kLogNormal
Definition:
logging_internal.h:64
LogBufferEntry::LogBufferEntry
LogBufferEntry(LogSource s, int m, const std::string &msg)
Definition:
logging_internal.h:115
kLogLevel0
Definition:
logging_internal.h:63
LogLevels
LogLevels
Definition:
logging_internal.h:62
kLogQuota
Definition:
logging_internal.h:82
kLogNfsMaps
Definition:
logging_internal.h:90
LogShutdown
void LogShutdown()
Definition:
logging.cc:595
kLogDns
Definition:
logging_internal.h:104
kLogHistory
Definition:
logging_internal.h:96
kLogFuse
Definition:
logging_internal.h:86
kLogMonitor
Definition:
logging_internal.h:84
kLogCvmfs
Definition:
logging_internal.h:78
kLogNone
Definition:
logging_internal.h:67
ClearLogBuffer
void ClearLogBuffer()
Definition:
logging.cc:528
LogFacilities
LogFacilities
Definition:
logging_internal.h:19
LogBufferEntry::message
std::string message
Definition:
logging_internal.h:121
kLogVerboseMsg
const int kLogVerboseMsg
Definition:
logging_internal.h:112
kLogCustom1
Definition:
logging_internal.h:27
SetLogSyslogPrefix
void SetLogSyslogPrefix(const std::string &prefix)
Definition:
logging.cc:240
kLogVerbose
Definition:
logging_internal.h:66
DefaultLogging::info
static LogFacilities info
Definition:
logging_internal.h:52
kLogCompress
Definition:
logging_internal.h:81
kLogSpooler
Definition:
logging_internal.h:92
kLogInfoMsg
const int kLogInfoMsg
Definition:
logging_internal.h:111
DefaultLogging::error
static LogFacilities error
Definition:
logging_internal.h:53
kLogUploadGateway
Definition:
logging_internal.h:101
LogBufferEntry
Definition:
logging_internal.h:114
GetLogSyslogFacility
int GetLogSyslogFacility()
Definition:
logging.cc:213
cvmfs
cvmfs
logging_internal.h
Generated on Sun May 22 2022 00:22:06 for CernVM-FS by
1.8.5