Constructor
new LogMan(logName, logFolderopt, optionsopt)
Constructor, provide the folder containing the logs and name of this log.
Logs are saved as: logFolder/logName.log
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
logName |
string
|
|||
logFolder |
string
|
<optional> |
"." | |
options |
ConstructorOptions
|
<optional> |
Members
consoleBeepOnLevel :logLevelsBoolean
Which levels to make a ding sound on (output bell character at the end of the console suffix)
- Source:
Type:
consoleDisplayLevel :logLevelsBoolean
Which levels to output to the console, (default is all, except debug and silly if `process.env.NODE_ENV !== "development"`)
- Source:
Type:
consoleMessageCharacterLimit :int
The maximum number of characters we'll print to the console each message.
- Source:
Type:
-
int
consoleMessageCharacterLimitString :string
This is the string appended on to a message that we've fit to the consoleMessageCharacterLimit.
That is, if your message is too long we'll truncate it fit within your limit and add this string to the end to signal the string was truncated.
- Source:
Type:
-
string
consolePrefix :string
String of text at the front of ALL messages.
You can include %date% for the date and %time% for the time
%logName% for the name of this log
` message `
- Source:
Type:
-
string
consolePrefixes :logLevelsString
String in front of messages logged to the console
` message `
- Source:
Type:
consoleSufix :string
String of text at the end of ALL messages (reset color)
` message `
- Source:
Type:
-
string
consoleSufixes :logLevelsString
String at the end of messages logged to the console
` message `
- Source:
Type:
fileLineTerminator
New line character in log file
`\r\n` for Win32
`\n` for not Win32
- Source:
fileMessageCharacterLimit :int
The maximum number of characters written out each log message to the file.
- Source:
Type:
-
int
fileMessageCharacterLimitString :string
This is the string appended on to a message that we've fit to the fileMessageCharacterLimit.
That is, if your message is too long we'll truncate it fit within your limit and add this string to the end to signal the string was truncated.
- Source:
Type:
-
string
filePrefix :string
String of text at the front of ALL messages written to FILE
You can include %date% for the date and %time% for the time
%logName% for the name of this log
` message `
- Source:
Type:
-
string
filePrefixes :logLevelsString
String in front of messages written to the file
` message `
- Source:
Type:
fileSufix :string
String of text at the end of ALL messages written to FILE
` message `
- Source:
Type:
-
string
fileSufixes :logLevelsString
String at the end of messages written to the file
` message `
- Source:
Type:
fileWriteLevel :logLevelsBoolean
Which log levels are written to the log file (default is all, except debug and silly if `process.env.NODE_ENV !== "development"`)
- Source:
Type:
objectRenderDepth :number
When logging objects, this dictates how deep we render the object. Default 2
- Source:
Type:
-
number
outputToConsole :boolean
Whether we output to the console. True by default
- Source:
Type:
-
boolean
outputToFile :boolean
Whether we output to the console. True by default
- Source:
Type:
-
boolean
Methods
close()
Closes the log file, no logging is permitted to file OR console after this. You can reopen via `Logger.reopen()`
Only works if `this.outputToFile` is true.
- Source:
Fires:
- LogMan#event:close
getLogger(loggerName, hideSectionNameopt) → {Logger}
Gives you a logger object so you can actually log data out.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
loggerName |
string
|
Name of this logger (section, class) | |
hideSectionName |
boolean
|
<optional> |
Allows you to hide the name of this logger |
Fires:
- Logger#event:newLogger
open()
Reopens the log files. Permits logging if previously closed.
- Source: