BDE 4.14.0 Production release
Loading...
Searching...
No Matches
ball::Log_Stream Class Reference

#include <ball_log.h>

Public Member Functions

 Log_Stream (const Category *category, const char *fileName, int lineNumber, int severity)
 
 ~Log_Stream () BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(false)
 
Recordrecord ()
 
bsl::ostream & stream ()
 
const Categorycategory () const
 
const Recordrecord () const
 
int severity () const
 Return the severity held by this logging stream.
 

Detailed Description

This class provides an aggregate of several objects relevant to the logging of a message via the C++ stream-based macros:

- record to be logged
- category to which to log the record
- severity at which to log the record
- stream to which the user log message is put
bsl::ostream & stream()
Definition ball_log.h:1912
const Category * category() const
Definition ball_log.h:1919
Record * record()
Definition ball_log.h:1906
int severity() const
Return the severity held by this logging stream.
Definition ball_log.h:1931

As a side-effect of creating an object of this class, the record and stream are also constructed. As a side-effect of destroying the object, the record is logged.

This class should not be used directly by client code. It is an implementation detail of the macros provided by this component.

See ball_log

Constructor & Destructor Documentation

◆ Log_Stream()

ball::Log_Stream::Log_Stream ( const Category category,
const char *  fileName,
int  lineNumber,
int  severity 
)

Create a logging stream that holds (1) the specified category and severity, (2) a record that is created from the specified fileName and lineNumber, and (3) an bsl::ostream to which the log message is put.

◆ ~Log_Stream()

ball::Log_Stream::~Log_Stream ( )

Log the record held by this logging stream to the held category (as returned by category) at the held severity (as returned by severity) and destroy this logging stream.

Member Function Documentation

◆ category()

const Category * ball::Log_Stream::category ( ) const
inline

Return the address of the non-modifiable category held by this logging stream.

◆ record() [1/2]

Record * ball::Log_Stream::record ( )
inline

Return the address of the modifiable log record held by this logging stream. The address remains valid until this logging stream is destroyed.

◆ record() [2/2]

const Record * ball::Log_Stream::record ( ) const
inline

Return the address of the non-modifiable log record held by this logging stream. The address remains valid until this logging stream is destroyed.

◆ severity()

int ball::Log_Stream::severity ( ) const
inline

◆ stream()

bsl::ostream & ball::Log_Stream::stream ( )
inline

Return a reference to the modifiable stream held by this logging stream. The reference remains valid until this logging stream is destroyed.


The documentation for this class was generated from the following file: