NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
CSysLog Class Reference

Search Toolkit Book for CSysLog

#include <corelib/syslog.hpp>

+ Inheritance diagram for CSysLog:
+ Collaboration diagram for CSysLog:

Public Types

enum  EFlags {
  fNoOverride = 0x40000000 , fCopyToStderr = 0x20000000 , fFallBackToConsole = 0x10000000 , fIncludePID = 0x08000000 ,
  fConnectNow = 0x04000000 , fNoChildWait = 0x02000000 , fAllFlags = 0x7e000000
}
 
enum  EPriority {
  eEmergency , eAlert , eCritical , eError ,
  eWarning , eNotice , eInfo , eDebug
}
 
enum  EFacility {
  eDefaultFacility , eKernel , eUser , eMail ,
  eDaemon , eAuth , eSysLog , eLPR ,
  eNews , eUUCP , eCron , eAuthPriv ,
  eFTP , eLocal0 , eLocal1 , eLocal2 ,
  eLocal3 , eLocal4 , eLocal5 , eLocal6 ,
  eLocal7
}
 
typedef int TFlags
 
- Public Types inherited from CDiagHandler
enum  EReopenFlags { fTruncate = 0x01 , fCheck = 0x02 , fDefault = 0 }
 
typedef int TReopenFlags
 

Public Member Functions

 CSysLog (const string &ident=kEmptyStr, TFlags flags=fNoOverride, EFacility default_facility=eDefaultFacility)
 
 CSysLog (const string &ident, TFlags flags, int default_facility)
 
 ~CSysLog ()
 
void Post (const SDiagMessage &mess)
 Post message to handler. More...
 
void Post (const string &message, EPriority priority, EFacility facility=eDefaultFacility)
 
void Post (const string &message, EPriority priority, int facility)
 
void HonorRegistrySettings (const IRegistry *reg=0)
 
string GetLogName (void)
 Get current diag posts destination. More...
 
- Public Member Functions inherited from CDiagHandler
virtual ~CDiagHandler (void)
 Destructor. More...
 
virtual void PostToConsole (const SDiagMessage &mess)
 Post message to console regardless of its severity. More...
 
virtual bool AllowAsyncWrite (const SDiagMessage &msg) const
 Check if the handler supports async writes. More...
 
virtual string ComposeMessage (const SDiagMessage &msg, EDiagFileType *file_type) const
 Compose message without writing it. More...
 
virtual void WriteMessage (const char *buf, size_t len, EDiagFileType file_type)
 Write string to the log. More...
 
virtual void Reopen (TReopenFlags)
 Reopen file to enable log rotation. More...
 

Static Public Attributes

static const char * kLogName_Syslog = "SYSLOG"
 

Private Member Functions

int x_TranslateFacility (EFacility facility)
 
void x_Connect (void)
 
 DECLARE_CLASS_STATIC_MUTEX (sm_Mutex)
 

Static Private Member Functions

static int x_TranslateFlags (TFlags flags)
 

Private Attributes

string m_Ident
 
TFlags m_Flags
 
int m_DefaultFacility
 

Static Private Attributes

static CSysLogsm_Current = NULL
 

Detailed Description

Definition at line 50 of file syslog.hpp.


The documentation for this class was generated from the following files:
Modified on Thu Feb 29 12:19:03 2024 by modify_doxy.py rev. 669887