setColorPrintersOptions function
void
setColorPrintersOptions({
- bool? enable,
- StringSink? outSink,
- StringSink? errSink,
- bool? useShortTag,
- bool? includeTimestamp,
- ConvertCallback<
DateTime, String> ? timestampFormatter,
Sets the options for printVerbose, printInfo, printWarning and printError.
Parameters
-
enable
- Whether or not the printer messages should be colorized. Defaults totrue
. -
outSink
- Output StringSink for non-erroneous messages. Defaults to stdout. -
outSink
- Output StringSink for non-erroneous messages. Defaults to stderr. -
useShortTag
- Whether short log tags should be used. Defaults tofalse
. -
includeTimestamp
- Whether timestamps should be included in the printed messages. Defaults tofalse
. -
timestampFormatter
- IfincludeTimestamp
istrue
, then this function determines how the DateTime is formatted in the final message. Defaults to DateTime.toString.
Implementation
void setColorPrintersOptions({
bool? enable,
StringSink? outSink,
StringSink? errSink,
bool? useShortTag,
bool? includeTimestamp,
ConvertCallback<DateTime, String>? timestampFormatter,
}) {
if (null != enable) {
_shouldColorize = enable;
}
if (null != outSink) {
_outSink = outSink;
}
if (null != errSink) {
_errSink = errSink;
}
if (null != useShortTag) {
_useShortTag = useShortTag;
}
if (null != includeTimestamp) {
_includeTimestamp = includeTimestamp;
}
if (null != timestampFormatter) {
_timestampFormatter = timestampFormatter;
}
}