Log: remove the obsolete printf-style functions

This commit is contained in:
Max Kellermann
2021-10-13 16:08:48 +02:00
parent 2fbbd540bb
commit 72f6e018e7
17 changed files with 102 additions and 283 deletions

View File

@@ -22,9 +22,9 @@
#include "LogCallback.hxx"
#include "Domain.hxx"
#include "LogV.hxx"
#include "util/Domain.hxx"
#include "util/StringFormat.hxx"
#include "Log.hxx"
extern "C" {
#include <libavutil/log.h>
@@ -60,6 +60,10 @@ FfmpegLogCallback(void *ptr, int level, const char *fmt, std::va_list vl)
ffmpeg_domain.GetName(),
cls->item_name(ptr));
const Domain d(domain);
LogFormatV(FfmpegImportLogLevel(level), d, fmt, vl);
char msg[1024];
vsnprintf(msg, sizeof(msg), fmt, vl);
Log(FfmpegImportLogLevel(level), d, msg);
}
}

View File

@@ -18,16 +18,21 @@
*/
#include "Manager.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "event/Loop.hxx"
#include "Log.hxx"
#include "util/DeleteDisposer.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
#include <string.h>
static constexpr Domain nfs_domain("nfs");
void
NfsManager::ManagedConnection::OnNfsConnectionError(std::exception_ptr &&e) noexcept
{
FormatError(e, "NFS error on %s:%s", GetServer(), GetExportName());
FmtError(nfs_domain, "NFS error on '{}:{}': {}",
GetServer(), GetExportName(), e);
/* defer deletion so the caller
(i.e. NfsConnection::OnSocketReady()) can still use this