Added rolling file logger.
h3rald h3rald@h3rald.com
Wed, 09 Nov 2016 12:43:36 +0100
3 files changed,
7 insertions(+),
6 deletions(-)
M
core/consts.nim
→
core/consts.nim
@@ -46,4 +46,5 @@ HOME = getenv("HOME")
let MINIMRC* = HOME / ".minimrc" let MINIMSYMBOLS* = HOME / ".minim_symbols" -let MINIMHISTORY* = HOME / ".minim_history"+let MINIMHISTORY* = HOME / ".minim_history" +let MINIMLOG* = HOME / "minim.log"
M
core/interpreter.nim
→
core/interpreter.nim
@@ -75,13 +75,13 @@ result.currSym = MinValue(column: 1, line: 1, kind: minSymbol, symVal: "")
proc formatError(sym: MinValue, message: string): string = if sym.filename.isNil or sym.filename == "": - return "$1`: $2" % [sym.symVal, message] + return "[$1]: $2" % [sym.symVal, message] else: - return "$1($2,$3) `$4`: $5" % [sym.filename, $sym.line, $sym.column, sym.symVal, message] + return "$1($2,$3) [$4]: $5" % [sym.filename, $sym.line, $sym.column, sym.symVal, message] proc formatTrace(sym: MinValue): string = if sym.filename.isNil or sym.filename == "": - return " - [native] in symbol: $1" % [sym.symVal] + return " - <native> in symbol: $1" % [sym.symVal] else: return " - $1($2,$3) in symbol: $4" % [sym.filename, $sym.line, $sym.column, sym.symVal]
M
minim.nim
→
minim.nim
@@ -38,8 +38,8 @@ min_lang
const PRELUDE* = "prelude.min".slurp.strip -var LOGGER* = newConsoleLogger() -LOGGER.addHandler() +newConsoleLogger().addHandler() +newRollingFileLogger(MINIMLOG, fmtStr = verboseFmtStr).addHandler() proc getExecs(): seq[string] = var res = newSeq[string](0)