Rename 'LogFormat' to 'LogOutputFormat'
This commit is contained in:
@@ -53,7 +53,7 @@ type
|
|||||||
COMMON, # Similar to Apache CommonLog Format
|
COMMON, # Similar to Apache CommonLog Format
|
||||||
TEXT # A more verbose text logging format
|
TEXT # A more verbose text logging format
|
||||||
|
|
||||||
proc parseLogFormat*(str: string; raiseErr: bool = false): LogOutputFormat =
|
proc parseLogOutputFormat*(str: string; raiseErr: bool = false): LogOutputFormat =
|
||||||
## Parse a logging format name into it's value
|
## Parse a logging format name into it's value
|
||||||
let ustr = str.toUpperAscii()
|
let ustr = str.toUpperAscii()
|
||||||
for i in LogOutputFormat:
|
for i in LogOutputFormat:
|
||||||
@@ -104,13 +104,13 @@ proc setLogLevel*(lvl: string) =
|
|||||||
## Set the log level from its string representation
|
## Set the log level from its string representation
|
||||||
logsLevel = lvl.parseLogLevel()
|
logsLevel = lvl.parseLogLevel()
|
||||||
|
|
||||||
proc setLogFormat*(fmt: LogOutputFormat) =
|
proc setLogOutputFormat*(fmt: LogOutputFormat) =
|
||||||
## Set the log output format to 'fmt'
|
## Set the log output format to 'fmt'
|
||||||
logsFormat = fmt
|
logsFormat = fmt
|
||||||
|
|
||||||
proc setLogFormat*(fmt: string) =
|
proc setLogOutputFormat*(fmt: string) =
|
||||||
## Set the log output format to 'fmt'
|
## Set the log output format to 'fmt'
|
||||||
logsFormat = fmt.parseLogFormat()
|
logsFormat = fmt.parseLogOutputFormat()
|
||||||
|
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
@@ -333,7 +333,7 @@ when isMainModule:
|
|||||||
|
|
||||||
for fmt in LogOutputFormat:
|
for fmt in LogOutputFormat:
|
||||||
echo "*** Setting log format to: ", $fmt
|
echo "*** Setting log format to: ", $fmt
|
||||||
setLogFormat(fmt)
|
setLogOutputFormat(fmt)
|
||||||
for ll in LogLevel:
|
for ll in LogLevel:
|
||||||
echo "** Setting level to: ", $ll
|
echo "** Setting level to: ", $ll
|
||||||
setLogLevel(ll)
|
setLogLevel(ll)
|
||||||
|
|||||||
Reference in New Issue
Block a user