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

Search Toolkit Book for CFileHandleDiagHandler

CFileHandleDiagHandler –. More...

#include <corelib/ncbidiag.hpp>

+ Inheritance diagram for CFileHandleDiagHandler:
+ Collaboration diagram for CFileHandleDiagHandler:

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

 CFileHandleDiagHandler (const string &fname, EDiagFileType file_type=eDiagFile_All)
 Constructor. More...
 ~CFileHandleDiagHandler (void)
 Close file handle. More...
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 Valid (void)
virtual void Reopen (TReopenFlags flags)
 Reopen file to enable log rotation. 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 Types

typedef deque< SDiagMessageTMessages
 Save messages if the handle is unavailable. More...

Private Attributes

EDiagFileType m_FileType
bool m_HavePosts
bool m_LowDiskSpace
unique_ptr< TMessagesm_Messages

Detailed Description

CFileHandleDiagHandler –.

Specialization of "CDiagHandler" for the file-handle based diagnostics. Writes messages using system write rather than stream to make the operation really atomic. Re-opens file periodically to make rotation possible.

Definition at line 2633 of file ncbidiag.hpp.

The documentation for this class was generated from the following files:
Modified on Wed Jul 24 17:20:07 2024 by rev. 669887