all repos — nifty @ edad1b737ee11eea4b610a10a8677cdce44bc996

A tiny (pseudo) package manager and script runner.

Minor fixes; Renamed StyledConsoleLogger into NiftyLogger.
h3rald h3rald@h3rald.com
Thu, 23 Feb 2017 21:28:40 +0100
commit

edad1b737ee11eea4b610a10a8677cdce44bc996

parent

9d95d6c017d753b61abc05fe436f9b865b4e37d6

4 files changed, 9 insertions(+), 9 deletions(-)

jump to
M lib/config.nimlib/config.nim

@@ -6,7 +6,7 @@ strutils,

logging import - styled_console_logger + niftylogger const cfgfile = "../nifty.nimble".slurp

@@ -19,7 +19,7 @@ f = newStringStream(cfgfile)

if f != nil: var p: CfgParser - open(p, f, "../minim.nimble") + open(p, f, "../nifty.nimble") while true: var e = next(p) case e.kind
M lib/styled_console_logger.nimlib/niftylogger.nim

@@ -6,7 +6,7 @@

system.addQuitProc(resetAttributes) type - StyledConsoleLogger* = ref object of Logger + NiftyLogger* = ref object of Logger proc logPrefix*(level: Level): tuple[msg: string, color: ForegroundColor] = case level:

@@ -25,7 +25,7 @@ return ("(x)", fgRed)

else: return (" ", fgWhite) -method log*(logger: StyledConsoleLogger; level: Level; args: varargs[string, `$`]) = +method log*(logger: NiftyLogger; level: Level; args: varargs[string, `$`]) = var f = stdout if level >= getLogFilter() and level >= logger.levelThreshold: if level >= lvlWarn:

@@ -39,7 +39,7 @@ resetAttributes()

f.write("\n") if level in {lvlError, lvlFatal}: flushFile(f) -proc newStyledConsoleLogger*(levelThreshold = lvlAll; fmtStr = " "): StyledConsoleLogger = +proc newNiftyLogger*(levelThreshold = lvlAll; fmtStr = " "): NiftyLogger = new result result.fmtStr = fmtStr result.levelThreshold = levelThreshold
M nifty.nimnifty.nim

@@ -7,9 +7,9 @@ strutils,

sequtils import - lib/styled_console_logger + lib/niftylogger -newStyledConsoleLogger().addHandler() +newNiftyLogger().addHandler() setLogFilter(lvlInfo) import
M nifty.nimblenifty.nimble

@@ -4,7 +4,7 @@ version = "0.1.0"

author = "Fabio Cevasco" description = "A pseudo package manager and script runner." license = "MIT" -bin = "minim" +bin = "nifty" [Deps] -requires: "nim >= 0.15.2" +requires: "nim >= 0.16.2"