summaryrefslogtreecommitdiff
path: root/src/Log.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-05-22 18:38:25 +0200
committerMax Kellermann <max@musicpd.org>2019-05-23 12:17:59 +0200
commite0d5d8810452265fe2e4d95eefb5585eb65f9ce5 (patch)
tree5405f3593158c9e425be4c7cbdd41b44ca78a0e8 /src/Log.cxx
parent585a74548485787525bb8b9c921b97ccced2f957 (diff)
Log: make LogLevel the first parameter
Prepare for templated functions.
Diffstat (limited to 'src/Log.cxx')
-rw-r--r--src/Log.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Log.cxx b/src/Log.cxx
index 6e47512c4..befe238c9 100644
--- a/src/Log.cxx
+++ b/src/Log.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2018 The Music Player Daemon Project
+ * Copyright 2003-2019 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -28,20 +28,20 @@
static constexpr Domain exception_domain("exception");
void
-LogFormatV(const Domain &domain, LogLevel level,
+LogFormatV(LogLevel level, const Domain &domain,
const char *fmt, va_list ap) noexcept
{
char msg[1024];
vsnprintf(msg, sizeof(msg), fmt, ap);
- Log(domain, level, msg);
+ Log(level, domain, msg);
}
void
-LogFormat(const Domain &domain, LogLevel level, const char *fmt, ...) noexcept
+LogFormat(LogLevel level, const Domain &domain, const char *fmt, ...) noexcept
{
va_list ap;
va_start(ap, fmt);
- LogFormatV(domain, level, fmt, ap);
+ LogFormatV(level, domain, fmt, ap);
va_end(ap);
}
@@ -50,7 +50,7 @@ FormatDebug(const Domain &domain, const char *fmt, ...) noexcept
{
va_list ap;
va_start(ap, fmt);
- LogFormatV(domain, LogLevel::DEBUG, fmt, ap);
+ LogFormatV(LogLevel::DEBUG, domain, fmt, ap);
va_end(ap);
}
@@ -59,7 +59,7 @@ FormatInfo(const Domain &domain, const char *fmt, ...) noexcept
{
va_list ap;
va_start(ap, fmt);
- LogFormatV(domain, LogLevel::INFO, fmt, ap);
+ LogFormatV(LogLevel::INFO, domain, fmt, ap);
va_end(ap);
}
@@ -68,7 +68,7 @@ FormatDefault(const Domain &domain, const char *fmt, ...) noexcept
{
va_list ap;
va_start(ap, fmt);
- LogFormatV(domain, LogLevel::DEFAULT, fmt, ap);
+ LogFormatV(LogLevel::DEFAULT, domain, fmt, ap);
va_end(ap);
}
@@ -77,7 +77,7 @@ FormatWarning(const Domain &domain, const char *fmt, ...) noexcept
{
va_list ap;
va_start(ap, fmt);
- LogFormatV(domain, LogLevel::WARNING, fmt, ap);
+ LogFormatV(LogLevel::WARNING, domain, fmt, ap);
va_end(ap);
}
@@ -86,7 +86,7 @@ FormatError(const Domain &domain, const char *fmt, ...) noexcept
{
va_list ap;
va_start(ap, fmt);
- LogFormatV(domain, LogLevel::ERROR, fmt, ap);
+ LogFormatV(LogLevel::ERROR, domain, fmt, ap);
va_end(ap);
}
@@ -142,7 +142,7 @@ FormatError(const std::exception_ptr &ep, const char *fmt, ...) noexcept
void
LogErrno(const Domain &domain, int e, const char *msg) noexcept
{
- LogFormat(domain, LogLevel::ERROR, "%s: %s", msg, strerror(e));
+ LogFormat(LogLevel::ERROR, domain, "%s: %s", msg, strerror(e));
}
void