|
Apache Log4cxx
Version 1.5.0
|
Go to the documentation of this file.
18 #ifndef _LOG4CXX_STREAM_H
19 #define _LOG4CXX_STREAM_H
55 void insert(std::ios_base & (*manip)(std::ios_base&));
87 std::ios_base::fmtflags
flags(std::ios_base::fmtflags newflags);
91 std::ios_base::fmtflags
setf(std::ios_base::fmtflags newflags, std::ios_base::fmtflags mask);
95 std::ios_base::fmtflags
setf(std::ios_base::fmtflags newflags);
154 const LOG4CXX_NS::spi::LocationInfo& location) = 0;
167 bool& fillSet)
const = 0;
183 class LOG4CXX_EXPORT logstream_ios_base :
public std::ios_base
186 logstream_ios_base(std::ios_base::fmtflags initval,
188 } initset, initclear;
212 LOG4CXX_NS::spi::LocationInfo location;
278 operator std::basic_ostream<Ch>& ();
280 #if !(LOG4CXX_USE_GLOBAL_SCOPE_TEMPLATE)
290 ((std::basic_ostream<char>&) *
this) << val;
301 const LOG4CXX_NS::spi::LocationInfo& location);
308 bool& fillSet)
const;
315 std::basic_stringstream<Ch>* stream;
319 #if LOG4CXX_WCHAR_T_API
382 operator std::basic_ostream<Ch>& ();
384 #if !(LOG4CXX_USE_GLOBAL_SCOPE_TEMPLATE)
394 ((std::basic_ostream<wchar_t>&) *
this) << val;
404 const LOG4CXX_NS::spi::LocationInfo& location);
411 bool& fillSet)
const;
418 std::basic_stringstream<Ch>* stream;
423 #if LOG4CXX_UNICHAR_API
443 #if LOG4CXX_UNICHAR_API
457 #if LOG4CXX_CFSTRING_API
493 operator std::basic_ostream<Ch>& ();
495 #if !(LOG4CXX_USE_GLOBAL_SCOPE_TEMPLATE)
505 ((std::basic_ostream<Ch>&) *
this) << val;
515 const LOG4CXX_NS::spi::LocationInfo& location);
522 bool& fillSet)
const;
529 std::basic_stringstream<Ch>* stream;
538 #if LOG4CXX_USE_GLOBAL_SCOPE_TEMPLATE
550 inline LOG4CXX_NS::logstream&
operator<<(LOG4CXX_NS::logstream& os,
const V& val)
554 ((std::basic_ostream<char>&) os) << val;
560 #if LOG4CXX_WCHAR_T_API
566 inline LOG4CXX_NS::wlogstream&
operator<<(LOG4CXX_NS::wlogstream& os,
const V& val)
570 ((std::basic_ostream<wchar_t>&) os) << val;
578 #if !defined(LOG4CXX_ENDMSG)
579 #if LOG4CXX_LOGSTREAM_ADD_NOP
580 #define LOG4CXX_ENDMSG (LOG4CXX_NS::logstream_manipulator) LOG4CXX_NS::logstream_base::nop >> LOG4CXX_LOCATION << (LOG4CXX_NS::logstream_manipulator) LOG4CXX_NS::logstream_base::endmsg
582 #define LOG4CXX_ENDMSG LOG4CXX_LOCATION << (LOG4CXX_NS::logstream_manipulator) LOG4CXX_NS::logstream_base::endmsg
587 #endif //_LOG4CXX_STREAM_H
virtual void refresh_stream_state()
virtual void erase()
Erase any content in the message construction buffer.
virtual ~logstream_base()
Destructor.
int fill(int newval)
Set fill character.
bool isEnabled() const
Returns true if the current level is the same or high as the level of logger at time of construction ...
Definition: stream.h:124
wlogstream(const log4cxx::LoggerPtr &logger, const log4cxx::LevelPtr &level)
Constructor.
logstream & operator>>(const log4cxx::spi::LocationInfo &location)
Alias for insertion operator for location.
wlogstream(const std::basic_string< Ch > &loggerName, const log4cxx::LevelPtr &level)
Constructor.
unsigned short UniChar
Definition: logstring.h:38
logstream(const Ch *loggerName, const log4cxx::LevelPtr &level)
Constructor.
logstream_base &(* logstream_manipulator)(logstream_base &)
Definition: stream.h:215
logstream_base(const log4cxx::LoggerPtr &logger, const log4cxx::LevelPtr &level)
Create new instance.
bool isEnabledFor(const LevelPtr &level) const
Returns if logger is currently enabled for the specified level.
logstream(const std::basic_string< Ch > &loggerName, const log4cxx::LevelPtr &level)
Constructor.
virtual void refresh_stream_state()
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 c...
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.
logstream & operator<<(const log4cxx::LevelPtr &level)
Insertion operator for level.
wlogstream & operator>>(const log4cxx::spi::LocationInfo &location)
Alias for insertion operator for location.
virtual void log(LoggerPtr &logger, const LevelPtr &level, const log4cxx::spi::LocationInfo &location)=0
Dispatches the pending log request.
const struct __CFString * CFStringRef
Definition: logstring.h:30
std::shared_ptr< Level > LevelPtr
Definition: optionconverter.h:27
log4cxx::wlogstream & operator<<(const V &val)
Template to allow any class with an std::basic_ostream inserter to be applied to this class.
Definition: stream.h:390
static logstream_base & endmsg(logstream_base &)
end of message manipulator, triggers logging.
std::ios_base::fmtflags flags(std::ios_base::fmtflags newflags)
Set flags.
ulogstream & operator<<(const V &val)
Template to allow any class with an std::basic_ostream inserter to be applied to this class.
Definition: stream.h:501
ulogstream & operator>>(const log4cxx::spi::LocationInfo &location)
Alias for insertion operator for location.
int fill()
Get fill character.
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 c...
int precision()
get precision.
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.
void setLevel(const LevelPtr &level)
Set the level.
logstream(const log4cxx::LoggerPtr &logger, const log4cxx::LevelPtr &level)
Constructor.
void insert(std::ios_base &(*manip)(std::ios_base &))
Insertion operator for std::fixed and similar manipulators.
ulogstream(const CFStringRef &loggerName, const log4cxx::LevelPtr &level)
virtual void erase()=0
Erase any content in the message construction buffer.
logstream & operator<<(std::ios_base &(*manip)(std::ios_base &))
Insertion operator for std::fixed and similar manipulators.
virtual void erase()
Erase any content in the message construction buffer.
virtual void log(LoggerPtr &logger, const LevelPtr &level, const log4cxx::spi::LocationInfo &location)
Dispatches the pending log request.
wlogstream & operator<<(std::ios_base &(*manip)(std::ios_base &))
Insertion operator for std::fixed and similar manipulators.
ulogstream & operator<<(const log4cxx::spi::LocationInfo &location)
Insertion operator for location.
void setLocation(const log4cxx::spi::LocationInfo &location)
Sets the location for subsequent log requests.
wlogstream & operator<<(const log4cxx::LevelPtr &level)
Insertion operator for level.
virtual void refresh_stream_state()
ulogstream(const log4cxx::LoggerPtr &logger, const log4cxx::LevelPtr &level)
Constructor.
int width(int newval)
set width.
An STL-like stream API for log4cxx using char as the character type.
Definition: stream.h:227
logstream & operator<<(logstream_manipulator manip)
Insertion operator for logstream_base::endmsg.
int precision(int newval)
set precision.
void end_message()
end of message action.
ulogstream & operator<<(const log4cxx::LevelPtr &level)
Insertion operator for level.
virtual void log(LoggerPtr &logger, const LevelPtr &level, const log4cxx::spi::LocationInfo &location)
Dispatches the pending log request.
ulogstream(const Ch *loggerName, const log4cxx::LevelPtr &level)
Constructor.
An STL-like stream API for log4cxx using wchar_t as the character type.
Definition: stream.h:330
wlogstream & operator<<(logstream_manipulator manip)
Insertion operator for logstream_base::endmsg.
ulogstream & operator<<(logstream_manipulator manip)
Insertion operator for logstream_base::endmsg.
log4cxx::logstream & operator<<(const V &val)
Template to allow any class with an std::basic_ostream inserter to be applied to this class.
Definition: stream.h:286
logstream & operator<<(const log4cxx::spi::LocationInfo &location)
Insertion operator for location.
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 c...
virtual void refresh_stream_state()=0
ulogstream(const std::basic_string< Ch > &loggerName, const log4cxx::LevelPtr &level)
Constructor.
wlogstream & operator<<(const log4cxx::spi::LocationInfo &location)
Insertion operator for location.
std::ios_base::fmtflags setf(std::ios_base::fmtflags newflags, std::ios_base::fmtflags mask)
Set flags.
std::basic_ostream< char > & operator<<(CharMessageBuffer &os, const V &val)
Definition: log4cxx/helpers/messagebuffer.h:208
#define LOG4CXX_UNLIKELY(expr)
Provides optimization hint to the compiler to optimize for the expression being false.
Definition: log4cxx/logger.h:2141
An STL-like stream API for log4cxx using UniChar as the character type.
Definition: stream.h:434
std::shared_ptr< Logger > LoggerPtr
Definition: defaultloggerfactory.h:26
ulogstream & operator<<(std::ios_base &(*manip)(std::ios_base &))
Insertion operator for std::fixed and similar manipulators.
wlogstream(const Ch *loggerName, const log4cxx::LevelPtr &level)
Constructor.
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 c...
std::ios_base::fmtflags setf(std::ios_base::fmtflags newflags)
Set flags.
Base class for the basic_logstream template which attempts to emulate std::basic_ostream but attempts...
Definition: stream.h:38
static logstream_base & nop(logstream_base &)
no-operation manipulator, Used to avoid ambiguity with VC6.