diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-06-09 10:48:55 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-06-15 14:49:54 +0300 |
commit | 953262f312b1412a9531d18851f9396defd18649 (patch) | |
tree | af6e78c785d226996700418772fcee1b862d08ce /src/cmd/cmd.cpp | |
parent | d5bf6f5c10ce9ce75ade59b5948c15f7829198a8 (diff) |
Reuse message pattern from gui
Diffstat (limited to 'src/cmd/cmd.cpp')
-rw-r--r-- | src/cmd/cmd.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp index 4a9999210..06f8c6b2e 100644 --- a/src/cmd/cmd.cpp +++ b/src/cmd/cmd.cpp @@ -192,12 +192,6 @@ void sync(const SyncCTX &ctx, int restartCount) } - -static void nullMessageHandler(QtMsgType, const QMessageLogContext &, const QString &) -{ -} - - class EchoDisabler { public: @@ -412,9 +406,9 @@ int main(int argc, char **argv) SyncCTX ctx { parseOptions(app.arguments()) }; if (ctx.options.silent) { - qInstallMessageHandler(nullMessageHandler); + qInstallMessageHandler([](QtMsgType, const QMessageLogContext &, const QString &) {}); } else { - qSetMessagePattern("%{time MM-dd hh:mm:ss:zzz} [ %{type} %{category} ]%{if-debug}\t[ %{function} ]%{endif}:\t%{message}"); + qSetMessagePattern(Logger::loggerPattern()); } ctx.account = Account::create(); @@ -435,7 +429,6 @@ int main(int argc, char **argv) auto tmp = QUrl::fromUserInput(ctx.options.target_url); // Find the folder and the original owncloud url QStringList splitted = tmp.path().split("/" + ctx.account->davPath()); - qDebug() << tmp.path() << ctx.account->davPath() << splitted; tmp.setPath(splitted.value(0)); tmp.setScheme(tmp.scheme().replace("owncloud", "http")); |