diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 00:22:50 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 10:56:02 -0400 |
commit | 9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch) | |
tree | 3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/logger/syslog_appender.h | |
parent | 01965cf52bce6976637ecb8f4a622aeb05ab256a (diff) | |
download | mongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz |
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/logger/syslog_appender.h')
-rw-r--r-- | src/mongo/logger/syslog_appender.h | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/mongo/logger/syslog_appender.h b/src/mongo/logger/syslog_appender.h index df0ba489fdf..ebdba636f5f 100644 --- a/src/mongo/logger/syslog_appender.h +++ b/src/mongo/logger/syslog_appender.h @@ -40,41 +40,41 @@ namespace mongo { namespace logger { - /** - * Appender for writing to syslog. Users must have separately called openlog(). - */ - template <typename Event> - class SyslogAppender : public Appender<Event> { - MONGO_DISALLOW_COPYING(SyslogAppender); +/** + * Appender for writing to syslog. Users must have separately called openlog(). + */ +template <typename Event> +class SyslogAppender : public Appender<Event> { + MONGO_DISALLOW_COPYING(SyslogAppender); - public: - typedef Encoder<Event> EventEncoder; +public: + typedef Encoder<Event> EventEncoder; - explicit SyslogAppender(EventEncoder* encoder) : _encoder(encoder) {} - virtual Status append(const Event& event) { - std::ostringstream os; - _encoder->encode(event, os); - if (!os) - return Status(ErrorCodes::LogWriteFailed, "Error writing log message to syslog."); - syslog(getSyslogPriority(event.getSeverity()), "%s", os.str().c_str()); - return Status::OK(); - } + explicit SyslogAppender(EventEncoder* encoder) : _encoder(encoder) {} + virtual Status append(const Event& event) { + std::ostringstream os; + _encoder->encode(event, os); + if (!os) + return Status(ErrorCodes::LogWriteFailed, "Error writing log message to syslog."); + syslog(getSyslogPriority(event.getSeverity()), "%s", os.str().c_str()); + return Status::OK(); + } - private: - int getSyslogPriority(LogSeverity severity) { - if (severity <= LogSeverity::Debug(1)) - return LOG_DEBUG; - if (severity == LogSeverity::Warning()) - return LOG_WARNING; - if (severity == LogSeverity::Error()) - return LOG_ERR; - if (severity >= LogSeverity::Severe()) - return LOG_CRIT; - // Info() and Log(). - return LOG_INFO; - } - std::unique_ptr<EventEncoder> _encoder; - }; +private: + int getSyslogPriority(LogSeverity severity) { + if (severity <= LogSeverity::Debug(1)) + return LOG_DEBUG; + if (severity == LogSeverity::Warning()) + return LOG_WARNING; + if (severity == LogSeverity::Error()) + return LOG_ERR; + if (severity >= LogSeverity::Severe()) + return LOG_CRIT; + // Info() and Log(). + return LOG_INFO; + } + std::unique_ptr<EventEncoder> _encoder; +}; } // namespace logger } // namespace mongo |