From ecf12a60e8f82df59b1cf1fcbab1609fb2dfd7f4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 4 Nov 2013 22:20:11 +0100 Subject: Log: add level "DEFAULT" Map LogLevel::INFO to G_LOG_LEVEL_INFO, and LogLevel::DEFAULT to G_LOG_LEVEL_MESSAGE. Now client connect/disconnect message are only logged on log_level "secure". --- src/Log.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/Log.cxx') diff --git a/src/Log.cxx b/src/Log.cxx index f36e68133..a46c0ced8 100644 --- a/src/Log.cxx +++ b/src/Log.cxx @@ -51,6 +51,9 @@ ToGLib(LogLevel level) return G_LOG_LEVEL_DEBUG; case LogLevel::INFO: + return G_LOG_LEVEL_INFO; + + case LogLevel::DEFAULT: return G_LOG_LEVEL_MESSAGE; case LogLevel::WARNING: @@ -101,6 +104,15 @@ FormatInfo(const Domain &domain, const char *fmt, ...) va_end(ap); } +void +FormatDefault(const Domain &domain, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + LogFormatV(domain, LogLevel::DEFAULT, fmt, ap); + va_end(ap); +} + void FormatWarning(const Domain &domain, const char *fmt, ...) { -- cgit v1.2.3