From e903e47cb0aada785e758264168d99bc4d0ad029 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 5 Feb 2016 11:38:45 +0100 Subject: Set debug output --- sinksh/syntax_modules/core_syntax.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'sinksh/syntax_modules/core_syntax.cpp') diff --git a/sinksh/syntax_modules/core_syntax.cpp b/sinksh/syntax_modules/core_syntax.cpp index 9325a7e..cb036b4 100644 --- a/sinksh/syntax_modules/core_syntax.cpp +++ b/sinksh/syntax_modules/core_syntax.cpp @@ -196,6 +196,17 @@ bool setLoggingFilter(const QStringList &commands, State &state) return true; } +bool setLoggingOutput(const QStringList &commands, State &state) +{ + QByteArrayList output; + for (const auto &c : commands) { + output << c.toLatin1(); + } + + Sink::Log::setDebugOutput(output); + return true; +} + Syntax::List syntax() { Syntax::List syntax; @@ -225,6 +236,10 @@ Syntax::List syntax() Syntax loggingFilter("loggingFilter", QObject::tr("Set logging filter."), &CoreSyntax::setLoggingFilter); set.children << loggingFilter; + Syntax loggingOutput("loggingOutput", QObject::tr("Set logging output."), &CoreSyntax::setLoggingFilter); + loggingOutput.completer = [](const QStringList &, const QString &fragment, State &state) -> QStringList { return Utils::filteredCompletions(QStringList() << "name" << "function" << "location" << "", fragment, Qt::CaseInsensitive); }; + set.children << loggingOutput; + syntax << set; Syntax get("get", QObject::tr("Gets settings for the session")); -- cgit v1.2.3