diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/logger/element.h | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/logger/element.h')
-rw-r--r-- | library/cpp/logger/element.h | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/library/cpp/logger/element.h b/library/cpp/logger/element.h index fc9bff851f..73ce81bf2f 100644 --- a/library/cpp/logger/element.h +++ b/library/cpp/logger/element.h @@ -1,48 +1,48 @@ #pragma once - -#include "priority.h" - -#include <util/stream/tempbuf.h> - -class TLog; - -/* - * better do not use directly - */ + +#include "priority.h" + +#include <util/stream/tempbuf.h> + +class TLog; + +/* + * better do not use directly + */ class TLogElement: public TTempBufOutput { -public: - TLogElement(const TLog* parent); +public: + TLogElement(const TLog* parent); TLogElement(const TLog* parent, ELogPriority priority); - TLogElement(TLogElement&&) noexcept = default; - TLogElement& operator=(TLogElement&&) noexcept = default; - - ~TLogElement() override; + TLogElement(TLogElement&&) noexcept = default; + TLogElement& operator=(TLogElement&&) noexcept = default; - template <class T> - inline TLogElement& operator<<(const T& t) { + ~TLogElement() override; + + template <class T> + inline TLogElement& operator<<(const T& t) { static_cast<IOutputStream&>(*this) << t; - - return *this; - } - - /* - * for pretty usage: logger << TLOG_ERROR << "Error description"; - */ + + return *this; + } + + /* + * for pretty usage: logger << TLOG_ERROR << "Error description"; + */ inline TLogElement& operator<<(ELogPriority priority) { - Flush(); - Priority_ = priority; - return *this; - } - + Flush(); + Priority_ = priority; + return *this; + } + ELogPriority Priority() const noexcept { - return Priority_; - } - -protected: - void DoFlush() override; - -protected: - const TLog* Parent_; + return Priority_; + } + +protected: + void DoFlush() override; + +protected: + const TLog* Parent_; ELogPriority Priority_; -}; +}; |