mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-11 01:11:43 +08:00
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@54463 954022d7-b5bf-4e40-9824-e11837661b57
58 lines
930 B
C++
58 lines
930 B
C++
#ifndef _CPDOCCORE_LOGGING_H_INCLUDED_
|
|
#define _CPDOCCORE_LOGGING_H_INCLUDED_
|
|
|
|
#include <iosfwd>
|
|
|
|
namespace cpdoccore {
|
|
|
|
#if 1
|
|
template <class Ostream>
|
|
class logging
|
|
{
|
|
public:
|
|
logging(Ostream & Ostream) : ostream_(Ostream)
|
|
{}
|
|
|
|
template <class T>
|
|
Ostream & operator << (const T & t)
|
|
{
|
|
return (ostream_ << t );
|
|
}
|
|
|
|
private:
|
|
Ostream & ostream_;
|
|
};
|
|
|
|
#else
|
|
|
|
template <class Ostream>
|
|
class logging
|
|
{
|
|
public:
|
|
logging(Ostream & Ostream)
|
|
{}
|
|
|
|
template <class T>
|
|
logging & operator << (const T & t)
|
|
{
|
|
return *this;
|
|
}
|
|
|
|
private:
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
extern logging< std::wostream > logging_err;
|
|
extern logging< std::wostream > logging_cout;
|
|
|
|
}
|
|
|
|
#define _CP_LOG_error ::cpdoccore::logging_err
|
|
#define _CP_LOG_info ::cpdoccore::logging_err
|
|
#define _CP_LOG_warning ::cpdoccore::logging_err
|
|
|
|
#define _CP_LOG(A) _CP_LOG_##A
|
|
|
|
#endif |