![]() |
CernVM-FS
2.11.0
|
#include "util/logging_internal.h"
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <syslog.h>
#include <time.h>
#include <unistd.h>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <vector>
#include "util/export.h"
#include "util/mutex.h"
#include "util/platform.h"
#include "util/posix.h"
#include "util/single_copy.h"
#include "util/smalloc.h"
Go to the source code of this file.
Classes | |
class | anonymous_namespace{logging.cc}::LogBuffer |
Namespaces | |
anonymous_namespace{logging.cc} | |
Functions | |
static void | LogCustom (unsigned id, const std::string &message) |
void | SetLogSyslogLevel (const int level) |
int | GetLogSyslogLevel () |
void | SetLogSyslogFacility (const int local_facility) |
int | GetLogSyslogFacility () |
void | SetLogSyslogPrefix (const std::string &prefix) |
void | SetLogSyslogShowPID (bool flag) |
void | SetLogVerbosity (const LogLevels max_level) |
void | SetLogMicroSyslogMaxSize (unsigned bytes) |
void | SetLogMicroSyslog (const std::string &filename) |
std::string | GetLogMicroSyslog () |
static void | LogMicroSyslog (const std::string &message) |
void | SetAltLogFunc (void(*fn)(const LogSource source, const int mask, const char *msg)) |
CVMFS_EXPORT void | vLogCvmfs (const LogSource source, const int mask, const char *format, va_list variadic_list) |
CVMFS_EXPORT void | LogCvmfs (const LogSource source, const int mask, const char *format,...) |
std::vector< LogBufferEntry > | GetLogBuffer () |
void | ClearLogBuffer () |
void | PrintError (const string &message) |
void | PrintWarning (const string &message) |
void | SetLogCustomFile (unsigned id, const std::string &filename) |
void | LogShutdown () |
void ClearLogBuffer | ( | ) |
std::vector<LogBufferEntry> GetLogBuffer | ( | ) |
Definition at line 535 of file logging.cc.
Referenced by LogBufferXattr::GetValue().
std::string GetLogMicroSyslog | ( | ) |
Definition at line 308 of file logging.cc.
Referenced by PosixQuotaManager::CreateShared(), and Watchdog::Fork().
int GetLogSyslogFacility | ( | ) |
Definition at line 214 of file logging.cc.
Referenced by PosixQuotaManager::CreateShared(), AuthzExternalFetcher::Handshake(), and SetLogSyslogShowPID().
int GetLogSyslogLevel | ( | ) |
Definition at line 168 of file logging.cc.
Referenced by PosixQuotaManager::CreateShared(), and AuthzExternalFetcher::Handshake().
|
static |
Definition at line 585 of file logging.cc.
Referenced by vLogCvmfs().
CVMFS_EXPORT void LogCvmfs | ( | const LogSource | source, |
const int | mask, | ||
const char * | format, | ||
... | |||
) |
|
static |
Definition at line 316 of file logging.cc.
Referenced by vLogCvmfs().
void LogShutdown | ( | ) |
void PrintError | ( | const string & | message | ) |
Definition at line 543 of file logging.cc.
Referenced by swissknife::CommandSync::CheckParams(), LibGlobals::Initialize(), swissknife::CommandTag::InitializeEnvironment(), swissknife::Ingest::Main(), swissknife::CommandCreate::Main(), swissknife::CommandUpload::Main(), and swissknife::CommandSync::Main().
void PrintWarning | ( | const string & | message | ) |
Definition at line 547 of file logging.cc.
Referenced by publish::SyncMediator::Add(), publish::SyncItem::MarkAsWhiteout(), publish::SyncMediator::Remove(), and publish::SyncMediator::Touch().
void SetAltLogFunc | ( | void(*)(const LogSource source, const int mask, const char *msg) | fn | ) |
Changes the debug log file from stderr. No effect if DEBUGMSG is undefined.
Definition at line 408 of file logging.cc.
Referenced by cvmfs_set_log_fn(), and download::MainResolveProxyDescription().
void SetLogCustomFile | ( | unsigned | id, |
const std::string & | filename | ||
) |
Opens a custom log file
Definition at line 555 of file logging.cc.
Referenced by LogShutdown().
void SetLogMicroSyslog | ( | const std::string & | filename | ) |
"Micro-Syslog" write kLogSyslog messages into filename. It rotates this file. Requires for µCernVM
Definition at line 272 of file logging.cc.
Referenced by Watchdog::Fork(), FuseMain(), LogShutdown(), main(), PosixQuotaManager::MainCacheManager(), loader::loader_talk::MainTalk(), FileSystem::SetupLoggingStandalone(), FileSystem::TearDown2ReadOnly(), and FileSystem::~FileSystem().
void SetLogMicroSyslogMaxSize | ( | unsigned | bytes | ) |
Definition at line 264 of file logging.cc.
void SetLogSyslogFacility | ( | const int | local_facility | ) |
Sets the syslog facility to one of local0 .. local7. Falls back to LOG_USER if local_facility is not in [0..7]
Definition at line 183 of file logging.cc.
Referenced by FuseMain(), main(), PosixQuotaManager::MainCacheManager(), and FileSystem::SetupLoggingStandalone().
void SetLogSyslogLevel | ( | const int | level | ) |
Sets the level that is used for all messages to the syslog facility.
Definition at line 151 of file logging.cc.
Referenced by FuseMain(), main(), PosixQuotaManager::MainCacheManager(), and FileSystem::SetupLoggingStandalone().
void SetLogSyslogPrefix | ( | const std::string & | prefix | ) |
The syslog prefix is used to distinguish multiple repositories in /var/log/messages
Definition at line 241 of file logging.cc.
Referenced by FuseMain(), main(), FileSystem::SetupLoggingStandalone(), and FileSystem::~FileSystem().
void SetLogSyslogShowPID | ( | bool | flag | ) |
Definition at line 254 of file logging.cc.
Referenced by main().
void SetLogVerbosity | ( | const LogLevels | max_level | ) |
Set the maximum verbosity level. By default kLogNormal.
Definition at line 261 of file logging.cc.
Referenced by swissknife::CommandInfo::Main(), swissknife::CommandPull::Main(), swissknife::CommandCheck::Main(), swissknife::CommandCreate::Main(), and swissknife::CommandSync::Main().
CVMFS_EXPORT void vLogCvmfs | ( | const LogSource | source, |
const int | mask, | ||
const char * | format, | ||
va_list | variadic_list | ||
) |
Logs a message to one or multiple facilities specified by mask. Mask can be extended by a log level in the future, using the higher bits.
[in] | source | Component that triggers the logging |
[in] | mask | Bit mask of log facilities |
[in] | format | Format string followed by arguments like printf |
Definition at line 423 of file logging.cc.
Referenced by LogCvmfs().