From 78a39a65783cf27441af1efa567a8609b0945351 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Fri, 30 Oct 2015 12:00:13 -0700 Subject: [PATCH] Fix #238 --- src/server/server.d | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/server/server.d b/src/server/server.d index 206e424..f569e09 100644 --- a/src/server/server.d +++ b/src/server/server.d @@ -53,19 +53,18 @@ version(OSX) version = useXDG; int main(string[] args) { - info("Starting up..."); - StopWatch sw = StopWatch(AutoStart.yes); - ushort port = 9166; bool help; bool printVersion; bool ignoreConfig; string[] importPaths; + LogLevel level = globalLogLevel; try { getopt(args, "port|p", &port, "I", &importPaths, "help|h", &help, - "version", &printVersion, "ignoreConfig", &ignoreConfig); + "version", &printVersion, "ignoreConfig", &ignoreConfig, + "logLevel", &level); } catch (ConvException e) { @@ -74,6 +73,11 @@ int main(string[] args) return 1; } + globalLogLevel = level; + + info("Starting up..."); + StopWatch sw = StopWatch(AutoStart.yes); + if (printVersion) { version (Windows) @@ -334,5 +338,9 @@ options: Prints the version number and then exits. --port PORTNUMBER | -pPORTNUMBER - Listens on PORTNUMBER instead of the default port 9166.`, programName); + Listens on PORTNUMBER instead of the default port 9166. + + --logLevel LEVEL + The logging level. Valid values are 'all', 'trace', 'info', 'warning', + 'error', 'critical', 'fatal', and 'off'`, programName); }