diff options
author | scop <scop> | 2005-04-18 19:26:16 +0000 |
---|---|---|
committer | scop <scop> | 2005-04-18 19:26:16 +0000 |
commit | f8a3d81fc0b548a0f76e205fee433e4c94a4ee57 (patch) | |
tree | 2f69513d7d57e15b920c8eb4bb4b4a877d5b0881 /dxr3log.h | |
parent | 37c4c7b0a4a388d6c933e95756ddd30dd0cca6fd (diff) | |
download | vdr-plugin-dxr3-f8a3d81fc0b548a0f76e205fee433e4c94a4ee57.tar.gz vdr-plugin-dxr3-f8a3d81fc0b548a0f76e205fee433e4c94a4ee57.tar.bz2 |
Oops, wrong tree... revert.
Diffstat (limited to 'dxr3log.h')
-rw-r--r-- | dxr3log.h | 90 |
1 files changed, 45 insertions, 45 deletions
@@ -29,65 +29,65 @@ // ================================== //! A log class. /*! - With this nice util dxr3plugin generates and mange a log file. In this - file the developer/enduser can find informations and can find errors, - problems and ohter stuff. + With this nice util dxr3plugin generates and mange a log file. In this + file the developer/enduser can find informations and can find errors, + problems and ohter stuff. */ class cLog : public Singleton<cLog> { - public: - cLog(); // use default log file - cLog(std::string FileName); +public: + cLog(); // use default log file + cLog(std::string FileName); - ~cLog() { Close(); } + ~cLog() { Close(); } - void SetForceFlush(const bool v) { m_ForeFlush = v; } - bool GetForceFlush() const { return m_ForeFlush; } + void SetForceFlush(const bool v) { m_ForeFlush = v; } + bool GetForceFlush() const { return m_ForeFlush; } - // write type data to log file. - template <class Type> - inline cLog& operator << ( Type item ) - { - if (m_LogOpen) + // write type data to log file. + template <class Type> + inline cLog& operator << ( Type item ) { - m_LogStream << item; - if (m_ForeFlush) m_LogStream.flush(); + if (m_LogOpen) + { + m_LogStream << item; + if (m_ForeFlush) m_LogStream.flush(); + } + return *this; } - return *this; - } - inline cLog& operator << ( size_t item ) - { - if (m_LogOpen) + inline cLog& operator << ( size_t item ) { - m_LogStream << (unsigned int)item; - if (m_ForeFlush) m_LogStream.flush(); + if (m_LogOpen) + { + m_LogStream << (unsigned int)item; + if (m_ForeFlush) m_LogStream.flush(); + } + return *this; } - return *this; - } - inline cLog& operator << ( bool item ) - { - if (m_LogOpen) + inline cLog& operator << ( bool item ) { - if (item == true) - { - m_LogStream << "true"; - } - else - { - m_LogStream << "false"; - } - if (m_ForeFlush) m_LogStream.flush(); + if (m_LogOpen) + { + if (item == true) + { + m_LogStream << "true"; + } + else + { + m_LogStream << "false"; + } + if (m_ForeFlush) m_LogStream.flush(); + } + return *this; } - return *this; - } - private: - std::ofstream m_LogStream; ///< Our logstream - bool m_LogOpen; ///< Is log open? - bool m_ForeFlush; ///< Do we want to flush log everytime? +private: + std::ofstream m_LogStream; ///< Our logstream + bool m_LogOpen; ///< Is log open? + bool m_ForeFlush; ///< Do we want to flush log everytime? - void Open(std::string Filename); // with this function we open our logfile - void Close(); // with this function we close our logfile + void Open(std::string Filename); // with this function we open our logfile + void Close(); // with this function we close our logfile }; |