CernVM-FS
2.12.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_UTIL_LOGGING_INTERNAL_H_
8
#define CVMFS_UTIL_LOGGING_INTERNAL_H_
9
10
#include <cstdarg>
11
#include <ctime>
12
#include <string>
13
#include <vector>
14
15
#include "
util/export.h
"
16
17
#ifdef CVMFS_NAMESPACE_GUARD
18
namespace
CVMFS_NAMESPACE_GUARD {
19
#endif
20
21
enum
LogFacilities
{
22
kLogDebug
= 0x01,
23
kLogStdout
= 0x02,
24
kLogStderr
= 0x04,
25
kLogSyslog
= 0x08,
26
kLogSyslogWarn
= 0x10,
27
kLogSyslogErr
= 0x20,
28
kLogCustom0
= 0x40,
29
kLogCustom1
= 0x80,
30
kLogCustom2
= 0x100,
31
};
32
48
struct
CVMFS_EXPORT
DefaultLogging
{
52
static
void
Set(
LogFacilities
info,
LogFacilities
error);
53
54
static
LogFacilities
info
;
// default kLogStdout
55
static
LogFacilities
error
;
// default kLogStderr
56
};
57
58
enum
LogFlags
{
59
kLogNoLinebreak
= 0x200,
60
kLogShowSource
= 0x400,
61
kLogSensitive
= 0x800,
62
};
63
64
enum
LogLevels
{
65
kLogLevel0
= 0x01000,
66
kLogNormal
= 0x02000,
67
kLogInform
= 0x04000,
68
kLogVerbose
= 0x08000,
69
kLogNone
= 0x10000,
70
};
71
76
enum
LogSource
{
77
kLogCache
= 1,
78
kLogCatalog
,
79
kLogSql
,
80
kLogCvmfs
,
81
kLogHash
,
82
kLogDownload
,
83
kLogCompress
,
84
kLogQuota
,
85
kLogTalk
,
86
kLogMonitor
,
87
kLogLru
,
88
kLogFuse
,
89
kLogSignature
,
90
kLogFsTraversal
,
91
kLogCatalogTraversal
,
92
kLogNfsMaps
,
93
kLogPublish
,
94
kLogSpooler
,
95
kLogConcurrency
,
96
kLogUtility
,
97
kLogGlueBuffer
,
98
kLogHistory
,
99
kLogUnionFs
,
100
kLogPathspec
,
101
kLogReceiver
,
102
kLogUploadS3
,
103
kLogUploadGateway
,
104
kLogS3Fanout
,
105
kLogGc
,
106
kLogDns
,
107
kLogAuthz
,
108
kLogReflog
,
109
kLogKvStore
,
110
kLogTelemetry
,
111
kLogCurl
112
};
113
114
const
int
kLogWarning
=
kLogStdout
|
kLogShowSource
|
kLogNormal
;
115
const
int
kLogInfoMsg
=
kLogStdout
|
kLogShowSource
|
kLogInform
;
116
const
int
kLogVerboseMsg
=
kLogStdout
|
kLogShowSource
|
kLogVerbose
;
117
118
struct
CVMFS_EXPORT
LogBufferEntry
{
119
LogBufferEntry
(
LogSource
s,
int
m,
const
std::string &msg)
120
: timestamp(time(NULL)), source(s),
mask
(m), message(msg) { }
121
122
time_t
timestamp
;
123
LogSource
source
;
124
int
mask
;
125
std::string
message
;
126
};
127
128
CVMFS_EXPORT
void
SetLogSyslogLevel
(
const
int
level);
129
CVMFS_EXPORT
int
GetLogSyslogLevel
();
130
CVMFS_EXPORT
void
SetLogSyslogFacility
(
const
int
facility);
131
CVMFS_EXPORT
int
GetLogSyslogFacility
();
132
CVMFS_EXPORT
void
SetLogCustomFile
(
unsigned
id
,
const
std::string &filename);
133
CVMFS_EXPORT
void
SetLogMicroSyslog
(
const
std::string &filename);
134
CVMFS_EXPORT
std::string
GetLogMicroSyslog
();
135
CVMFS_EXPORT
void
SetLogMicroSyslogMaxSize
(
unsigned
bytes);
136
CVMFS_EXPORT
void
SetLogSyslogPrefix
(
const
std::string &prefix);
137
CVMFS_EXPORT
void
SetLogSyslogShowPID
(
bool
flag);
138
CVMFS_EXPORT
void
SetLogVerbosity
(
const
LogLevels
max_level);
139
CVMFS_EXPORT
void
LogShutdown
();
140
141
#ifdef DEBUGMSG
142
CVMFS_EXPORT
void
SetLogDebugFile
(
const
std::string &filename);
143
CVMFS_EXPORT
std::string
GetLogDebugFile
();
144
#else
145
#define SetLogDebugFile(filename) ((void)0)
146
#define GetLogDebugFile() (std::string(""))
147
#endif
148
149
CVMFS_EXPORT
150
void
SetAltLogFunc
(
void
(*fn)(
const
LogSource
source,
const
int
mask
,
151
const
char
*msg));
152
153
CVMFS_EXPORT
std::vector<LogBufferEntry>
GetLogBuffer
();
154
CVMFS_EXPORT
void
ClearLogBuffer
();
155
156
CVMFS_EXPORT
void
PrintWarning
(
const
std::string &message);
157
CVMFS_EXPORT
void
PrintError
(
const
std::string &message);
158
159
#ifdef CVMFS_NAMESPACE_GUARD
160
}
// namespace CVMFS_NAMESPACE_GUARD
161
#endif
162
163
#endif // CVMFS_UTIL_LOGGING_INTERNAL_H_
GetLogBuffer
std::vector< LogBufferEntry > GetLogBuffer()
Definition:
logging.cc:535
SetLogSyslogFacility
void SetLogSyslogFacility(const int local_facility)
Definition:
logging.cc:183
SetLogVerbosity
void SetLogVerbosity(const LogLevels max_level)
Definition:
logging.cc:261
SetLogSyslogLevel
void SetLogSyslogLevel(const int level)
Definition:
logging.cc:151
kLogLru
Definition:
logging_internal.h:87
kLogHash
Definition:
logging_internal.h:81
kLogKvStore
Definition:
logging_internal.h:109
kLogSyslogErr
Definition:
logging_internal.h:27
kLogUploadS3
Definition:
logging_internal.h:102
kLogUtility
Definition:
logging_internal.h:96
LogBufferEntry::source
LogSource source
Definition:
logging_internal.h:123
SetLogSyslogShowPID
void SetLogSyslogShowPID(bool flag)
Definition:
logging.cc:254
export.h
LogBufferEntry::timestamp
time_t timestamp
Definition:
logging_internal.h:122
kLogPublish
Definition:
logging_internal.h:93
kLogWarning
const int kLogWarning
Definition:
logging_internal.h:114
LogFlags
LogFlags
Definition:
logging_internal.h:58
kLogDebug
Definition:
logging_internal.h:22
kLogGc
Definition:
logging_internal.h:105
kLogTalk
Definition:
logging_internal.h:85
kLogSignature
Definition:
logging_internal.h:89
CVMFS_EXPORT
#define CVMFS_EXPORT
Definition:
export.h:11
SetLogMicroSyslogMaxSize
void SetLogMicroSyslogMaxSize(unsigned bytes)
Definition:
logging.cc:264
kLogConcurrency
Definition:
logging_internal.h:95
LogBufferEntry::mask
int mask
Definition:
logging_internal.h:124
kLogCatalogTraversal
Definition:
logging_internal.h:91
kLogNoLinebreak
Definition:
logging_internal.h:59
SetAltLogFunc
void SetAltLogFunc(void(*fn)(const LogSource source, const int mask, const char *msg))
Definition:
logging.cc:408
kLogFsTraversal
Definition:
logging_internal.h:90
SetLogMicroSyslog
void SetLogMicroSyslog(const std::string &filename)
Definition:
logging.cc:272
kLogShowSource
Definition:
logging_internal.h:60
SetLogDebugFile
#define SetLogDebugFile(filename)
Definition:
logging_internal.h:145
kLogReflog
Definition:
logging_internal.h:108
kLogDownload
Definition:
logging_internal.h:82
kLogStdout
Definition:
logging_internal.h:23
kLogStderr
Definition:
logging_internal.h:24
GetLogSyslogLevel
int GetLogSyslogLevel()
Definition:
logging.cc:168
kLogSyslogWarn
Definition:
logging_internal.h:26
kLogTelemetry
Definition:
logging_internal.h:110
GetLogDebugFile
#define GetLogDebugFile()
Definition:
logging_internal.h:146
kLogCatalog
Definition:
logging_internal.h:78
DefaultLogging
Definition:
logging_internal.h:48
kLogGlueBuffer
Definition:
logging_internal.h:97
kLogSensitive
Don't add the line to the memory log buffer.
Definition:
logging_internal.h:61
kLogUnionFs
Definition:
logging_internal.h:99
kLogInform
Definition:
logging_internal.h:67
kLogCustom2
Definition:
logging_internal.h:30
kLogS3Fanout
Definition:
logging_internal.h:104
kLogPathspec
Definition:
logging_internal.h:100
kLogReceiver
Definition:
logging_internal.h:101
LogSource
LogSource
Definition:
logging_internal.h:76
kLogAuthz
Definition:
logging_internal.h:107
SetLogCustomFile
void SetLogCustomFile(unsigned id, const std::string &filename)
Definition:
logging.cc:555
kLogSyslog
Definition:
logging_internal.h:25
kLogCache
Definition:
logging_internal.h:77
kLogSql
Definition:
logging_internal.h:79
GetLogMicroSyslog
std::string GetLogMicroSyslog()
Definition:
logging.cc:308
kLogCustom0
Definition:
logging_internal.h:28
PrintWarning
void PrintWarning(const string &message)
Definition:
logging.cc:547
kLogNormal
Definition:
logging_internal.h:66
LogBufferEntry::LogBufferEntry
LogBufferEntry(LogSource s, int m, const std::string &msg)
Definition:
logging_internal.h:119
kLogLevel0
Definition:
logging_internal.h:65
LogLevels
LogLevels
Definition:
logging_internal.h:64
kLogQuota
Definition:
logging_internal.h:84
kLogNfsMaps
Definition:
logging_internal.h:92
LogShutdown
void LogShutdown()
Definition:
logging.cc:606
kLogDns
Definition:
logging_internal.h:106
kLogHistory
Definition:
logging_internal.h:98
kLogFuse
Definition:
logging_internal.h:88
kLogMonitor
Definition:
logging_internal.h:86
kLogCvmfs
Definition:
logging_internal.h:80
kLogNone
Definition:
logging_internal.h:69
ClearLogBuffer
void ClearLogBuffer()
Definition:
logging.cc:539
LogFacilities
LogFacilities
Definition:
logging_internal.h:21
kLogCurl
Definition:
logging_internal.h:111
LogBufferEntry::message
std::string message
Definition:
logging_internal.h:125
kLogVerboseMsg
const int kLogVerboseMsg
Definition:
logging_internal.h:116
mask
const int mask
Definition:
logging.h:23
kLogCustom1
Definition:
logging_internal.h:29
SetLogSyslogPrefix
void SetLogSyslogPrefix(const std::string &prefix)
Definition:
logging.cc:241
PrintError
void PrintError(const string &message)
Definition:
logging.cc:543
kLogVerbose
Definition:
logging_internal.h:68
DefaultLogging::info
static LogFacilities info
Definition:
logging_internal.h:54
kLogCompress
Definition:
logging_internal.h:83
kLogSpooler
Definition:
logging_internal.h:94
kLogInfoMsg
const int kLogInfoMsg
Definition:
logging_internal.h:115
DefaultLogging::error
static LogFacilities error
Definition:
logging_internal.h:55
kLogUploadGateway
Definition:
logging_internal.h:103
LogBufferEntry
Definition:
logging_internal.h:118
GetLogSyslogFacility
int GetLogSyslogFacility()
Definition:
logging.cc:214
cvmfs
cvmfs
util
logging_internal.h
Generated on Sun Dec 29 2024 01:18:13 for CernVM-FS by
1.8.5