CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
logging_internal.h File Reference
#include <cstdarg>
#include <ctime>
#include <string>
#include <vector>
#include "util/export.h"
Include dependency graph for logging_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  DefaultLogging
 
struct  LogBufferEntry
 

Macros

#define SetLogDebugFile(filename)   ((void)0)
 
#define GetLogDebugFile()   (std::string(""))
 

Enumerations

enum  LogFacilities {
  kLogDebug = 0x01, kLogStdout = 0x02, kLogStderr = 0x04, kLogSyslog = 0x08,
  kLogSyslogWarn = 0x10, kLogSyslogErr = 0x20, kLogCustom0 = 0x40, kLogCustom1 = 0x80,
  kLogCustom2 = 0x100
}
 
enum  LogFlags { kLogNoLinebreak = 0x200, kLogShowSource = 0x400, kLogSensitive = 0x800 }
 
enum  LogLevels {
  kLogLevel0 = 0x01000, kLogNormal = 0x02000, kLogInform = 0x04000, kLogVerbose = 0x08000,
  kLogNone = 0x10000
}
 
enum  LogSource {
  kLogCache = 1, kLogCatalog, kLogSql, kLogCvmfs,
  kLogHash, kLogDownload, kLogCompress, kLogQuota,
  kLogTalk, kLogMonitor, kLogLru, kLogFuse,
  kLogSignature, kLogFsTraversal, kLogCatalogTraversal, kLogNfsMaps,
  kLogPublish, kLogSpooler, kLogConcurrency, kLogUtility,
  kLogGlueBuffer, kLogHistory, kLogUnionFs, kLogPathspec,
  kLogReceiver, kLogUploadS3, kLogUploadGateway, kLogS3Fanout,
  kLogGc, kLogDns, kLogAuthz, kLogReflog,
  kLogKvStore, kLogTelemetry, kLogCurl
}
 

Functions

CVMFS_EXPORT void SetLogSyslogLevel (const int level)
 
CVMFS_EXPORT int GetLogSyslogLevel ()
 
CVMFS_EXPORT void SetLogSyslogFacility (const int facility)
 
CVMFS_EXPORT int GetLogSyslogFacility ()
 
CVMFS_EXPORT void SetLogCustomFile (unsigned id, const std::string &filename)
 
CVMFS_EXPORT void SetLogMicroSyslog (const std::string &filename)
 
CVMFS_EXPORT std::string GetLogMicroSyslog ()
 
CVMFS_EXPORT void SetLogMicroSyslogMaxSize (unsigned bytes)
 
CVMFS_EXPORT void SetLogSyslogPrefix (const std::string &prefix)
 
CVMFS_EXPORT void SetLogSyslogShowPID (bool flag)
 
CVMFS_EXPORT void SetLogVerbosity (const LogLevels max_level)
 
CVMFS_EXPORT void LogShutdown ()
 
CVMFS_EXPORT void SetAltLogFunc (void(*fn)(const LogSource source, const int mask, const char *msg))
 
CVMFS_EXPORT std::vector
< LogBufferEntry
GetLogBuffer ()
 
CVMFS_EXPORT void ClearLogBuffer ()
 
CVMFS_EXPORT void PrintWarning (const std::string &message)
 
CVMFS_EXPORT void PrintError (const std::string &message)
 

Variables

const int kLogWarning = kLogStdout | kLogShowSource | kLogNormal
 
const int kLogInfoMsg = kLogStdout | kLogShowSource | kLogInform
 
const int kLogVerboseMsg = kLogStdout | kLogShowSource | kLogVerbose
 

Macro Definition Documentation

#define GetLogDebugFile ( )    (std::string(""))
#define SetLogDebugFile (   filename)    ((void)0)

Enumeration Type Documentation

This file is part of the CernVM File System.

Enumerator
kLogDebug 
kLogStdout 
kLogStderr 
kLogSyslog 
kLogSyslogWarn 
kLogSyslogErr 
kLogCustom0 
kLogCustom1 
kLogCustom2 

Definition at line 21 of file logging_internal.h.

enum LogFlags
Enumerator
kLogNoLinebreak 
kLogShowSource 
kLogSensitive 

Don't add the line to the memory log buffer.

Definition at line 58 of file logging_internal.h.

enum LogLevels
Enumerator
kLogLevel0 
kLogNormal 
kLogInform 
kLogVerbose 
kLogNone 

Definition at line 64 of file logging_internal.h.

enum LogSource

Changes in this enum must be done in logging.cc as well! (see const char *module_names[] = {....})

Enumerator
kLogCache 
kLogCatalog 
kLogSql 
kLogCvmfs 
kLogHash 
kLogDownload 
kLogCompress 
kLogQuota 
kLogTalk 
kLogMonitor 
kLogLru 
kLogFuse 
kLogSignature 
kLogFsTraversal 
kLogCatalogTraversal 
kLogNfsMaps 
kLogPublish 
kLogSpooler 
kLogConcurrency 
kLogUtility 
kLogGlueBuffer 
kLogHistory 
kLogUnionFs 
kLogPathspec 
kLogReceiver 
kLogUploadS3 
kLogUploadGateway 
kLogS3Fanout 
kLogGc 
kLogDns 
kLogAuthz 
kLogReflog 
kLogKvStore 
kLogTelemetry 
kLogCurl 

Definition at line 76 of file logging_internal.h.

Function Documentation

CVMFS_EXPORT void ClearLogBuffer ( )

Definition at line 539 of file logging.cc.

Here is the call graph for this function:

CVMFS_EXPORT std::vector<LogBufferEntry> GetLogBuffer ( )

Definition at line 535 of file logging.cc.

Referenced by LogBufferXattr::FinalizeValue().

Here is the call graph for this function:

Here is the caller graph for this function:

CVMFS_EXPORT std::string GetLogMicroSyslog ( )

Definition at line 308 of file logging.cc.

Referenced by PosixQuotaManager::CreateShared(), and Watchdog::Fork().

Here is the caller graph for this function:

CVMFS_EXPORT int GetLogSyslogFacility ( )

Definition at line 214 of file logging.cc.

Referenced by PosixQuotaManager::CreateShared(), AuthzExternalFetcher::Handshake(), and SetLogSyslogShowPID().

Here is the caller graph for this function:

CVMFS_EXPORT int GetLogSyslogLevel ( )

Definition at line 168 of file logging.cc.

Referenced by PosixQuotaManager::CreateShared(), and AuthzExternalFetcher::Handshake().

Here is the caller graph for this function:

CVMFS_EXPORT void LogShutdown ( )

Definition at line 606 of file logging.cc.

Here is the call graph for this function:

CVMFS_EXPORT void PrintError ( const std::string &  message)
CVMFS_EXPORT void PrintWarning ( const std::string &  message)
CVMFS_EXPORT 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().

Here is the caller graph for this function:

CVMFS_EXPORT void SetLogCustomFile ( unsigned  id,
const std::string &  filename 
)

Opens a custom log file

Definition at line 555 of file logging.cc.

Referenced by LogShutdown().

Here is the call graph for this function:

Here is the caller graph for this function:

CVMFS_EXPORT 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().

Here is the call graph for this function:

Here is the caller graph for this function:

CVMFS_EXPORT void SetLogMicroSyslogMaxSize ( unsigned  bytes)

Definition at line 264 of file logging.cc.

CVMFS_EXPORT 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().

Here is the caller graph for this function:

CVMFS_EXPORT 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().

Here is the caller graph for this function:

CVMFS_EXPORT 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().

Here is the caller graph for this function:

CVMFS_EXPORT void SetLogSyslogShowPID ( bool  flag)

Definition at line 254 of file logging.cc.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

CVMFS_EXPORT 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().

Here is the caller graph for this function:

Variable Documentation

const int kLogInfoMsg = kLogStdout | kLogShowSource | kLogInform

Definition at line 115 of file logging_internal.h.

const int kLogVerboseMsg = kLogStdout | kLogShowSource | kLogVerbose

Definition at line 116 of file logging_internal.h.

Referenced by catalog::WritableCatalogManager::AddDirectory(), catalog::WritableCatalog::AddFileChunk(), catalog::WritableCatalogManager::AddHardlinkGroup(), catalog::WritableCatalogManager::Balance(), catalog::WritableCatalogManager::CatalogUploadCallback(), swissknife::CommandTag::CloseAndPublishHistory(), catalog::WritableCatalog::Commit(), catalog::WritableCatalogManager::Commit(), publish::SyncMediator::Commit(), publish::SyncMediator::CompleteHardlinks(), FileSystemTraversal< T >::DoRecursion(), upload::LocalUploader::DoUpload(), swissknife::CommandCheck::Exists(), catalog::WritableCatalogManager::FinalizeCatalog(), upload::LocalUploader::FinalizeStreamedUpload(), swissknife::CommandCheck::Find(), swissknife::CommandEditTag::GetTagRootHash(), ConcurrentWorkers< WorkerT >::Initialize(), publish::SyncMediator::InsertHardlink(), publish::SyncMediator::InsertLegacyHardlink(), swissknife::CommandPull::Main(), swissknife::CommandApplyDirtab::Main(), swissknife::MainWorker(), MemoryMappedFile::Map(), upload::LocalUploader::Move(), TaskRegister::Process(), publish::SyncUnion::ProcessFile(), publish::SyncMediator::PublishFilesCallback(), publish::SyncMediator::PublishHardlinksCallback(), catalog::WritableCatalogManager::RemoveDirectory(), publish::SyncMediator::RemoveFile(), SigningTool::Run(), ConcurrentWorkers< WorkerT >::RunCallbackThreadWrapper(), ConcurrentWorkers< WorkerT >::RunWorker(), catalog::WritableCatalogManager::SnapshotCatalogs(), catalog::WritableCatalogManager::SnapshotCatalogsSerialized(), upload::LocalUploader::StreamedUpload(), ConcurrentWorkers< WorkerT >::Terminate(), catalog::WritableCatalogManager::TouchDirectory(), catalog::WritableCatalog::Transaction(), publish::SyncUnionAufs::Traverse(), publish::SyncUnionOverlayfs::Traverse(), MemoryMappedFile::Unmap(), swissknife::CommandTag::UpdateUndoTags(), swissknife::CommandTag::UploadCatalogAndUpdateManifest(), and ConcurrentWorkers< WorkerT >::WaitForEmptyQueue().