options.nim: set default log level to NOTICE
This commit is contained in:
parent
4493dd5b7a
commit
057853015c
|
@ -1,6 +1,6 @@
|
|||
2022-07-13 Anna <cyber@sysrq.in>
|
||||
|
||||
* 0.3.0 tagged
|
||||
* 0.3.0, 0.3.1 tagged
|
||||
|
||||
* nim.cfg: switch to --gc:orc, disable threads
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
|||
|
||||
* nimbus.nim: add debug output
|
||||
|
||||
* options.nim (initLogger): set default log level to NOTICE
|
||||
|
||||
2022-07-04 Anna <cyber@sysrq.in>
|
||||
|
||||
* 0.2.4, 0.2.5 tagged
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
# Package
|
||||
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
author = "Anna"
|
||||
description = "A Nim build system"
|
||||
license = "BSD"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import std/strutils
|
||||
|
||||
const
|
||||
nimbusVersion* = "0.3.0"
|
||||
nimbusVersion* = "0.3.1"
|
||||
|
||||
defaultBinDir* = "/usr/local/bin"
|
||||
defaultNimbleDir* = "/opt/nimble"
|
||||
|
|
|
@ -51,6 +51,8 @@ proc initLogger*(options: Options) =
|
|||
addHandler(options.logger)
|
||||
if options.debug:
|
||||
setLogFilter(lvlDebug)
|
||||
else:
|
||||
setLogFilter(lvlNotice)
|
||||
|
||||
proc setLogger*(options: var Options) =
|
||||
options.logger = newConsoleLogger()
|
||||
|
@ -172,6 +174,10 @@ func parseArgument(key: string, argc: var int, result: var Options) =
|
|||
else: discard
|
||||
|
||||
proc parseCmdLine*(): Options =
|
||||
# set default values here
|
||||
result.debug = false
|
||||
result.showHelp = false
|
||||
|
||||
var argc = 0
|
||||
for kind, key, val in getOpt():
|
||||
case kind
|
||||
|
|
Loading…
Reference in New Issue
Block a user