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

Search Toolkit Book for CFileDiagHandler

CFileDiagHandler –. More...

#include <corelib/ncbidiag.hpp>

+ Inheritance diagram for CFileDiagHandler:
+ Collaboration diagram for CFileDiagHandler:

Public Types

typedef CStreamDiagHandler_Base TParent
 
- Public Types inherited from CDiagHandler
enum  EReopenFlags { fTruncate = 0x01 , fCheck = 0x02 , fDefault = 0 }
 
typedef int TReopenFlags
 

Public Member Functions

 CFileDiagHandler (void)
 Constructor. More...
 
 ~CFileDiagHandler (void)
 
virtual void Post (const SDiagMessage &mess)
 Post message to the handler. 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...
 
bool SetLogFile (const string &file_name, EDiagFileType file_type, bool quick_flush)
 Set new log file. More...
 
string GetLogFile (EDiagFileType file_type) const
 Get current log file name. More...
 
CNcbiOstreamGetLogStream (EDiagFileType file_type)
 Get current log stream. More...
 
virtual void Reopen (TReopenFlags flags)
 Reopen file to enable log rotation. More...
 
void SetSubHandler (CStreamDiagHandler_Base *handler, EDiagFileType file_type, bool own)
 
void SetOwnership (CStreamDiagHandler_Base *handler, bool own)
 Change ownership for the given handler if it's currently installed. More...
 
- Public Member Functions inherited from CStreamDiagHandler_Base
 CStreamDiagHandler_Base (void)
 
virtual string GetLogName (void)
 Get current diag posts destination. More...
 
virtual CNcbiOstreamGetStream (void)
 
- 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...
 

Protected Member Functions

virtual void SetLogName (const string &log_name)
 
- Protected Member Functions inherited from CStreamDiagHandler_Base
void SetLogName (const string &log_name)
 

Private Member Functions

EDiagFileType x_GetDiagFileType (const SDiagMessage &msg) const
 
CStreamDiagHandler_Basex_GetHandler (EDiagFileType file_type) const
 
void x_ResetHandler (CStreamDiagHandler_Base **ptr, bool *owned)
 
void x_SetHandler (CStreamDiagHandler_Base **member, bool *own_member, CStreamDiagHandler_Base *handler, bool own)
 

Private Attributes

CStreamDiagHandler_Basem_Err
 
bool m_OwnErr
 
CStreamDiagHandler_Basem_Log
 
bool m_OwnLog
 
CStreamDiagHandler_Basem_Trace
 
bool m_OwnTrace
 
CStreamDiagHandler_Basem_Perf
 
bool m_OwnPerf
 
CStopWatchm_ReopenTimer
 

Detailed Description

CFileDiagHandler –.

Specialization of "CDiagHandler" for the file-based diagnostics. Splits output into three files: .err (severity higher than the threshold), .trace (severity below the threshold) and .log (application access log). Re-opens the files periodically to allow safe log rotation.

Definition at line 2697 of file ncbidiag.hpp.


The documentation for this class was generated from the following files:
Modified on Mon Mar 04 05:11:35 2024 by modify_doxy.py rev. 669887