Apache log4cxx Version 0.10.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | List of all members
logstream Class Reference

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

Inherits logstream_base.

## Public Member Functions
| logstream (const log4cxx::LoggerPtr &logger, const log4cxx::LevelPtr &level)
| Constructor. More...
| logstream (const Ch *loggerName, const log4cxx::LevelPtr &level)
| Constructor. More...
| logstream (const std::basic_string< Ch > &loggerName, const log4cxx::LevelPtr &level)
| Constructor. More...
| ~logstream ()
logstream & | operator<< (std::ios_base &(*manip)(std::ios_base &))
| Insertion operator for std::fixed and similar manipulators. More...
logstream & | operator<< (logstream_manipulator manip)
| Insertion operator for logstream_base::endmsg. More...
logstream & | operator<< (const log4cxx::LevelPtr &level)
| Insertion operator for level. More...
logstream & | operator<< (const log4cxx::spi::LocationInfo &location)
| Insertion operator for location. More...
logstream & | operator>> (const log4cxx::spi::LocationInfo &location)
| Alias for insertion operator for location. More...
| operator std::basic_ostream< Ch > & ()
| Cast operator to provide access to embedded std::basic_ostream. More...
template<class V >
log4cxx::logstream & | operator<< (const V &val)
| Template to allow any class with an std::basic_ostream inserter to be applied to this class. More...
Public Member Functions inherited from logstream_base
| logstream_base (const log4cxx::LoggerPtr &logger, const log4cxx::LevelPtr &level)
| Create new instance. More...
virtual | ~logstream_base ()
| Destructor. More...
void | insert (std::ios_base &(*manip)(std::ios_base &))
| Insertion operator for std::fixed and similar manipulators. More...
int | precision ()
| get precision. More...
int | width ()
| get width. More...
int | precision (int newval)
| set precision. More...
int | width (int newval)
| set width. More...
int | fill ()
| Get fill character. More...
int | fill (int newval)
| Set fill character. More...
std::ios_base::fmtflags | flags (std::ios_base::fmtflags newflags)
| Set flags. More...
std::ios_base::fmtflags | setf (std::ios_base::fmtflags newflags, std::ios_base::fmtflags mask)
| Set flags. More...
std::ios_base::fmtflags | setf (std::ios_base::fmtflags newflags)
| Set flags. More...
void | end_message ()
| end of message action. More...
void | setLevel (const LevelPtr &level)
| Set the level. More...
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. More...
bool | isEnabledFor (const LevelPtr &level) const
| Returns if logger is currently enabled for the specified level. More...
void | setLocation (const log4cxx::spi::LocationInfo &location)
| Sets the location for subsequent log requests. More...
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. More...

## Protected Member Functions
virtual void | log (LoggerPtr &logger, const LevelPtr &level, const log4cxx::spi::LocationInfo &location)
| Dispatches the pending log request. More...
virtual void | erase ()
| Erase any content in the message construction buffer. More...
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. More...
virtual void | refresh_stream_state ()

## Additional Inherited Members
Static Public Member Functions inherited from logstream_base
static logstream_base & | endmsg (logstream_base &)
| end of message manipulator, triggers logging. More...
static logstream_base & | nop (logstream_base &)
| no-operation manipulator, Used to avoid ambiguity with VC6. More...

## Detailed Description

An STL-like stream API for log4cxx using char 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

logstream | ( | const log4cxx::LoggerPtr & | logger,
|  | const log4cxx::LevelPtr & | level
| ) |  |

Constructor.

logstream | ( | const Ch * | loggerName,
|  | const log4cxx::LevelPtr & | level
| ) |  |

Constructor.

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

Constructor.

~logstream | ( |  | ) |

## Member Function Documentation

virtual void erase | ( |  | ) |
| protected virtual

Erase any content in the message construction buffer.

Implements logstream_base.

virtual void get_stream_state | ( | std::ios_base & | base,
|  | std::ios_base & | mask,
|  | int & | fill,
|  | bool & | fillSet
| ) |  | const
| protected virtual

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

Implements logstream_base.

virtual void log | ( | LoggerPtr & | logger,
|  | const LevelPtr & | level,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  |
| protected virtual

Dispatches the pending log request.

Implements logstream_base.

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

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

logstream& operator<< | ( | std::ios_base &(*)(std::ios_base &) | manip | ) |

Insertion operator for std::fixed and similar manipulators.

logstream& operator<< | ( | logstream_manipulator | manip | ) |

Insertion operator for logstream_base::endmsg.

logstream& operator<< | ( | const log4cxx::LevelPtr & | level | ) |

Insertion operator for level.

logstream& operator<< | ( | const log4cxx::spi::LocationInfo & | location | ) |

Insertion operator for location.

log4cxx::logstream& operator<< | ( | const V & | val | ) |
| inline

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

logstream& operator>> | ( | const log4cxx::spi::LocationInfo & | location | ) |

Alias for insertion operator for location.

Kludge to avoid inappropriate compiler ambiguity.

virtual void refresh_stream_state | ( |  | ) |
| protected virtual

Implements logstream_base.

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

- stream.h