summaryrefslogtreecommitdiffstats
path: root/sinksh/syntax_modules/core_syntax.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-05 11:38:45 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-05 11:38:45 +0100
commite903e47cb0aada785e758264168d99bc4d0ad029 (patch)
tree4bde3e74fa3cd045be3a2eb13591588ab2acda5d /sinksh/syntax_modules/core_syntax.cpp
parentb16f3a02c8a4904f75f5c10ccc7eedac845cd940 (diff)
downloadsink-e903e47cb0aada785e758264168d99bc4d0ad029.tar.gz
sink-e903e47cb0aada785e758264168d99bc4d0ad029.zip
Set debug output
Diffstat (limited to 'sinksh/syntax_modules/core_syntax.cpp')
-rw-r--r--sinksh/syntax_modules/core_syntax.cpp15
1 files changed, 15 insertions, 0 deletions
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)
196 return true; 196 return true;
197} 197}
198 198
199bool setLoggingOutput(const QStringList &commands, State &state)
200{
201 QByteArrayList output;
202 for (const auto &c : commands) {
203 output << c.toLatin1();
204 }
205
206 Sink::Log::setDebugOutput(output);
207 return true;
208}
209
199Syntax::List syntax() 210Syntax::List syntax()
200{ 211{
201 Syntax::List syntax; 212 Syntax::List syntax;
@@ -225,6 +236,10 @@ Syntax::List syntax()
225 Syntax loggingFilter("loggingFilter", QObject::tr("Set logging filter."), &CoreSyntax::setLoggingFilter); 236 Syntax loggingFilter("loggingFilter", QObject::tr("Set logging filter."), &CoreSyntax::setLoggingFilter);
226 set.children << loggingFilter; 237 set.children << loggingFilter;
227 238
239 Syntax loggingOutput("loggingOutput", QObject::tr("Set logging output."), &CoreSyntax::setLoggingFilter);
240 loggingOutput.completer = [](const QStringList &, const QString &fragment, State &state) -> QStringList { return Utils::filteredCompletions(QStringList() << "name" << "function" << "location" << "", fragment, Qt::CaseInsensitive); };
241 set.children << loggingOutput;
242
228 syntax << set; 243 syntax << set;
229 244
230 Syntax get("get", QObject::tr("Gets settings for the session")); 245 Syntax get("get", QObject::tr("Gets settings for the session"));