new KlasaConsole( [options])
Constructs our KlasaConsole instance
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
options |
KlasaConsoleConfig |
<optional> |
The options for the klasa console. |
- Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L116
Properties
-
colors :boolean|Colors
-
The colors for this console.
Type:
- boolean | Colors
- Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L149
-
stderr :WritableStream
-
The standard error output stream for this console, defaulted to process.stderr.
Type:
- WritableStream
- Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L127
-
stdout :WritableStream
-
The standard output stream for this console, defaulted to process.stderr.
Type:
- WritableStream
- Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L119
-
timestamps :boolean|string
-
Whether or not timestamps should be enabled for this console.
Type:
- boolean | string
- Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L140
-
useColors :boolean
-
Whether or not this console should use colors.
Type:
- boolean
- Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L147
Methods
-
<static> flatten(data, useColors)
-
Flattens our data into a readable string.
Parameters:
Name Type Description data* Some data to flatten useColorsboolean Whether or not the inspection should color the output - Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L296
Returns:
- Type
- string
-
debug(data)
-
Calls a debug write with everything to the console/writable stream.
Parameters:
Name Type Argument Description data* <repeatable>
The data we want to print. - Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L241
Returns:
- Type
- void
-
error(data)
-
Calls an error write with everything to the console/writable stream.
Parameters:
Name Type Argument Description data* <repeatable>
The data we want to print. - Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L231
Returns:
- Type
- void
-
log(data)
-
Calls a log write with everything to the console/writable stream.
Parameters:
Name Type Argument Description data* <repeatable>
The data we want to print. - Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L211
Returns:
- Type
- void
-
messages(string, message)
-
Logs everything to the console/writable stream.
Parameters:
Name Type Description stringstring The data we want to print. messagestring The message format used for coloring - Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L284
Returns:
- Type
- string
-
timestamp(timestamp, time)
-
Logs everything to the console/writable stream.
Parameters:
Name Type Description timestampDate The timestamp to maybe format timestring The time format used for coloring - Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L272
Returns:
- Type
- string
-
verbose(data)
-
Calls a verbose write with everything to the console/writable stream.
Parameters:
Name Type Argument Description data* <repeatable>
The data we want to print. - Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L251
Returns:
- Type
- void
-
warn(data)
-
Calls a warn write with everything to the console/writable stream.
Parameters:
Name Type Argument Description data* <repeatable>
The data we want to print. - Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L221
Returns:
- Type
- void
-
write(data [, type])
-
Logs everything to the console/writable stream.
Parameters:
Name Type Argument Default Description data* The data we want to print. typestring <optional>
"log" The type of log, particularly useful for coloring. - Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L196
-
wtf(data)
-
Calls a wtf (what a terrible failure) write with everything to the console/writable stream.
Parameters:
Name Type Argument Description data* <repeatable>
The data we want to print. - Since:
-
- 0.4.0
- Source:
- lib/util/Console.js#L261
Returns:
- Type
- void
Type Definitions
-
BackgroundColorTypes
-
One of these strings, HexStrings, RGB, or HSL are valid types.
Type:
- *
- Source:
- lib/util/Console.js#L73
Properties:
Name Type Argument Description blackstring redstring greenstring bluestring magentastring cyanstring graystring greystring lightgraystring lightgreystring lightredstring lightgreenstring lightyellowstring lightbluestring lightmagentastring lightcyanstring whitestring #008000string green 255,0,0Array <optional>
red 229,50%,50%Array <optional>
blue -
Colors
-
Time is for the timestamp of the log, message is for the actual output.
Type:
- object
- Source:
- lib/util/Console.js#L11
Properties:
Name Type Description debugKlasaConsoleColorObjects An object containing a message and time color object. errorKlasaConsoleColorObjects An object containing a message and time color object. logKlasaConsoleColorObjects An object containing a message and time color object. verboseKlasaConsoleColorObjects An object containing a message and time color object. warnKlasaConsoleColorObjects An object containing a message and time color object. wtfKlasaConsoleColorObjects An object containing a message and time Color Object. -
KlasaConsoleColorObjects
-
Type:
- object
- Source:
- lib/util/Console.js#L22
Properties:
Name Type Argument Default Description typestring <optional>
'log' The method from Console this color object should call. messageKlasaConsoleMessageObject A message object containing colors and styles. timeKlasaConsoleTimeObject A time object containing colors and styles. -
KlasaConsoleMessageObject
-
Type:
- object
- Source:
- lib/util/Console.js#L30
Properties:
Name Type Description backgroundBackgroundColorTypes The background color. Can be a basic string like "red", a hex string, or a RGB array. textTextColorTypes The text color. Can be a basic string like "red", a hex string, or a RGB array. styleStyleTypes A style string from StyleTypes. -
KlasaConsoleTimeObject
-
Type:
- object
- Source:
- lib/util/Console.js#L38
Properties:
Name Type Description backgroundBackgroundColorTypes The background color. Can be a basic string like "red", a hex string, or a RGB array. textTextColorTypes The text color. Can be a basic string like "red", a hex string, a RGB array, or HSL array. styleStyleTypes A style string from StyleTypes. -
StyleTypes
-
Type:
- *
- Source:
- lib/util/Console.js#L98
Properties:
Name Type Description normalstring boldstring dimstring italicstring underlinestring inversestring hiddenstring strikethroughstring -
TextColorTypes
-
All the valid color types.
Type:
- *
- Source:
- lib/util/Console.js#L46
Properties:
Name Type Argument Description blackstring redstring greenstring yellowstring bluestring magentastring cyanstring graystring greystring lightgraystring lightgreystring lightredstring lightgreenstring lightyellowstring lightbluestring lightmagentastring lightcyanstring whitestring #008000string green #008000string green 255,0,0Array <optional>
red 229,50%,50%Array <optional>
blue