Apache Log4cxx  Version 1.3.0
Loading...
Searching...
No Matches
log4cxx::ulogstream Class Reference

An STL-like stream API for log4cxx using UniChar as the character type. More...

#include <stream.h>

Inheritance diagram for log4cxx::ulogstream:
log4cxx::logstream_base

Public Member Functions

 ulogstream (const log4cxx::LoggerPtr &logger, const log4cxx::LevelPtr &level)
 Constructor.
 
 ulogstream (const Ch *loggerName, const log4cxx::LevelPtr &level)
 Constructor.
 
 ulogstream (const std::basic_string< Ch > &loggerName, const log4cxx::LevelPtr &level)
 Constructor.
 
 ulogstream (const CFStringRef &loggerName, const log4cxx::LevelPtr &level)
 
 ~ulogstream ()
 
ulogstreamoperator<< (std::ios_base &(*manip)(std::ios_base &))
 Insertion operator for std::fixed and similar manipulators.
 
ulogstreamoperator<< (logstream_manipulator manip)
 Insertion operator for logstream_base::endmsg.
 
ulogstreamoperator<< (const log4cxx::LevelPtr &level)
 Insertion operator for level.
 
ulogstreamoperator<< (const log4cxx::spi::LocationInfo &location)
 Insertion operator for location.
 
ulogstreamoperator>> (const log4cxx::spi::LocationInfo &location)
 Alias for insertion operator for location.
 
 operator std::basic_ostream< Ch > & ()
 Cast operator to provide access to embedded std::basic_ostream.
 
template<class V >
ulogstreamoperator<< (const V &val)
 Template to allow any class with an std::basic_ostream inserter to be applied to this class.
 
- Public Member Functions inherited from log4cxx::logstream_base
 logstream_base (const log4cxx::LoggerPtr &logger, const log4cxx::LevelPtr &level)
 Create new instance.
 
virtual ~logstream_base ()
 Destructor.
 
void insert (std::ios_base &(*manip)(std::ios_base &))
 Insertion operator for std::fixed and similar manipulators.
 
int precision ()
 get precision.
 
int width ()
 get width.
 
int precision (int newval)
 set precision.
 
int width (int newval)
 set width.
 
int fill ()
 Get fill character.
 
int fill (int newval)
 Set fill character.
 
std::ios_base::fmtflags flags (std::ios_base::fmtflags newflags)
 Set flags.
 
std::ios_base::fmtflags setf (std::ios_base::fmtflags newflags, std::ios_base::fmtflags mask)
 Set flags.
 
std::ios_base::fmtflags setf (std::ios_base::fmtflags newflags)
 Set flags.
 
void end_message ()
 end of message action.
 
void setLevel (const LevelPtr &level)
 Set the level.
 
bool isEnabled () const
 Returns true if the current level is the same or high as the level of logger at time of construction or last setLevel.
 
bool isEnabledFor (const LevelPtr &level) const
 Returns if logger is currently enabled for the specified level.
 
void setLocation (const log4cxx::spi::LocationInfo &location)
 Sets the location for subsequent log requests.
 
bool set_stream_state (std::ios_base &os, int &fillchar)
 Sets the state of the embedded stream (if any) to the state of the formatting info.
 

Protected Member Functions

virtual void log (LoggerPtr &logger, const LevelPtr &level, const log4cxx::spi::LocationInfo &location)
 Dispatches the pending log request.
 
virtual void erase ()
 Erase any content in the message construction buffer.
 
virtual void get_stream_state (std::ios_base &base, std::ios_base &mask, int &fill, bool &fillSet) const
 Copy state of embedded stream (if any) to value and mask instances of std::ios_base and return fill character value.
 
virtual void refresh_stream_state ()
 
virtual void log (LoggerPtr &logger, const LevelPtr &level, const log4cxx::spi::LocationInfo &location)=0
 Dispatches the pending log request.
 
virtual void erase ()=0
 Erase any content in the message construction buffer.
 
virtual void get_stream_state (std::ios_base &base, std::ios_base &mask, int &fill, bool &fillSet) const =0
 Copy state of embedded stream (if any) to value and mask instances of std::ios_base and return fill character value.
 
virtual void refresh_stream_state ()=0
 

Additional Inherited Members

- Static Public Member Functions inherited from log4cxx::logstream_base
static logstream_baseendmsg (logstream_base &)
 end of message manipulator, triggers logging.
 
static logstream_basenop (logstream_base &)
 no-operation manipulator, Used to avoid ambiguity with VC6.
 

Detailed Description

An STL-like stream API for log4cxx using UniChar as the character type.

. Instances of log4cxx::logstream are not designedfor use by multiple threads and in general should be short-lived function scoped objects. Using log4cxx::basic_logstream as a class member or static instance should be avoided in the same manner as you would avoid placing a std::ostringstream in those locations. Insertion operations are generally short-circuited if the level for the stream is not the same of higher that the level of the associated logger.

Constructor & Destructor Documentation

◆ ulogstream() [1/4]

log4cxx::ulogstream::ulogstream ( const log4cxx::LoggerPtr logger,
const log4cxx::LevelPtr level 
)

Constructor.

◆ ulogstream() [2/4]

log4cxx::ulogstream::ulogstream ( const Ch *  loggerName,
const log4cxx::LevelPtr level 
)

Constructor.

◆ ulogstream() [3/4]

log4cxx::ulogstream::ulogstream ( const std::basic_string< Ch > &  loggerName,
const log4cxx::LevelPtr level 
)

Constructor.

◆ ulogstream() [4/4]

log4cxx::ulogstream::ulogstream ( const CFStringRef loggerName,
const log4cxx::LevelPtr level 
)

◆ ~ulogstream()

log4cxx::ulogstream::~ulogstream ( )

Member Function Documentation

◆ erase()

virtual void log4cxx::ulogstream::erase ( )
protectedvirtual

Erase any content in the message construction buffer.

Implements log4cxx::logstream_base.

◆ get_stream_state()

virtual void log4cxx::ulogstream::get_stream_state ( std::ios_base &  base,
std::ios_base &  mask,
int &  fill,
bool &  fillSet 
) const
protectedvirtual

Copy state of embedded stream (if any) to value and mask instances of std::ios_base and return fill character value.

Implements log4cxx::logstream_base.

◆ log()

virtual void log4cxx::ulogstream::log ( LoggerPtr logger,
const LevelPtr level,
const log4cxx::spi::LocationInfo location 
)
protectedvirtual

Dispatches the pending log request.

Implements log4cxx::logstream_base.

◆ operator std::basic_ostream< Ch > &()

log4cxx::ulogstream::operator std::basic_ostream< Ch > & ( )

Cast operator to provide access to embedded std::basic_ostream.

◆ operator<<() [1/5]

ulogstream & log4cxx::ulogstream::operator<< ( const log4cxx::LevelPtr level)

Insertion operator for level.

◆ operator<<() [2/5]

ulogstream & log4cxx::ulogstream::operator<< ( const log4cxx::spi::LocationInfo location)

Insertion operator for location.

◆ operator<<() [3/5]

template<class V >
ulogstream & log4cxx::ulogstream::operator<< ( const V &  val)
inline

Template to allow any class with an std::basic_ostream inserter to be applied to this class.

◆ operator<<() [4/5]

ulogstream & log4cxx::ulogstream::operator<< ( logstream_manipulator  manip)

Insertion operator for logstream_base::endmsg.

◆ operator<<() [5/5]

ulogstream & log4cxx::ulogstream::operator<< ( std::ios_base &(*)(std::ios_base &)  manip)

Insertion operator for std::fixed and similar manipulators.

◆ operator>>()

ulogstream & log4cxx::ulogstream::operator>> ( const log4cxx::spi::LocationInfo location)

Alias for insertion operator for location.

Kludge to avoid inappropriate compiler ambiguity.

◆ refresh_stream_state()

virtual void log4cxx::ulogstream::refresh_stream_state ( )
protectedvirtual

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