6 #include "zypp/base/LogControl.h"
7 #include "zypp/base/LogTools.h"
8 #include <zypp/base/Logger.h>
10 #include <zypp/base/String.h>
11 #include <zypp/base/Iterator.h>
12 #include <zypp/base/Algorithm.h>
13 #include <zypp/base/Functional.h>
15 ///////////////////////////////////////////////////////////////////
17 ///////////////////////////////////////////////////////////////////
21 FormatStream( std::ostream & stream_r )
25 FormatStream & operator<<( std::ostream & (*fnc)( std::ostream & ) )
26 { _stream << fnc; return *this; }
29 FormatStream & operator<<( const _Tp & obj )
30 { _stream << "@(" << obj << ")@"; return *this; }
32 std::ostream & _stream;
34 ///////////////////////////////////////////////////////////////////
44 #define XXX FormatStream(_XXX( ZYPP_BASE_LOGGER_LOGGROUP ))
45 #define DBG FormatStream(_DBG( ZYPP_BASE_LOGGER_LOGGROUP ))
46 #define MIL FormatStream(_MIL( ZYPP_BASE_LOGGER_LOGGROUP ))
47 #define WAR FormatStream(_WAR( ZYPP_BASE_LOGGER_LOGGROUP ))
48 #define ERR FormatStream(_ERR( ZYPP_BASE_LOGGER_LOGGROUP ))
49 #define SEC FormatStream(_SEC( ZYPP_BASE_LOGGER_LOGGROUP ))
50 #define INT FormatStream(_INT( ZYPP_BASE_LOGGER_LOGGROUP ))
51 #define USR FormatStream(_USR( ZYPP_BASE_LOGGER_LOGGROUP ))
52 ///////////////////////////////////////////////////////////////////
54 ///////////////////////////////////////////////////////////////////
58 struct PrintOn : public std::unary_function<_Tp, bool>
60 bool operator()( const _Tp & obj ) const
63 _str << std::endl << _prfx << obj;
65 _str << _prfx << obj << std::endl;
69 PrintOn( std::ostream & str, const std::string & prfx = std::string(), bool leadNL = false )
80 ///////////////////////////////////////////////////////////////////
81 #endif // MA_PRINTING_H