From: APTX Date: Sun, 9 Oct 2022 03:30:59 +0000 (+0900) Subject: Make logs of property read/write errors critical errors X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=8b7e121e9b316c15a04ce38f758cb654f3d66af5;p=aniplayer.git Make logs of property read/write errors critical errors --- diff --git a/backendplugins/backend_mpv/mpvhelper.h b/backendplugins/backend_mpv/mpvhelper.h index 82838e6..7d70ae4 100644 --- a/backendplugins/backend_mpv/mpvhelper.h +++ b/backendplugins/backend_mpv/mpvhelper.h @@ -180,12 +180,15 @@ auto ReadFormat(const Handle &handle, Format format, const char *name) -> Outcome { typename Format::MpvInternalType data; int error = mpv_get_property(handle.get(), name, format.format, &data); - qCDebug(mpvHelper()).nospace() - << "ReadFormat, property: " << name << ", error: " << error - << ", original value: " << data; if (error != MPV_ERROR_SUCCESS) { + qCCritical(mpvHelper()).nospace() + << "ReadFormat failure, property: " << name << ", error: " << error + << ", original value: " << data; return Error{error}; } + qCDebug(mpvHelper()).nospace() + << "ReadFormat, property: " << name << ", original value: " << data; + typename Format::type ret; TypeConversion::convert(data, ret); @@ -201,9 +204,15 @@ int WriteFormat(const Handle &handle, Format format, const char *name, int error = mpv_set_property(handle.get(), name, format.format, const_cast(&data)); - qCDebug(mpvHelper()).nospace() - << "WriteFormat, property: " << name << ", error: " << error - << ", original value: " << value << ", converted value: " << data; + if (error != MPV_ERROR_SUCCESS) { + qCCritical(mpvHelper()).nospace() + << "WriteFormat failure, property: " << name << ", error: " << error + << ", original value: " << value << ", converted value: " << data; + } else { + qCDebug(mpvHelper()).nospace() + << "WriteFormat, property: " << name << ", original value: " << value + << ", converted value: " << data; + } return error; }