debug method
Implementation
void debug(dynamic msg, [String prefix = '']) {
if (_opts['debug'] == true) {
if (msg is Exception) {
msg = msg.toString();
} else if (msg is! String) {
try {
msg = utf8.decode(msg);
} catch (e) {
return;
}
} else if (msg != NULL) {
msg.toString();
} else {
log('NATS::$prefix IS NULL');
return;
}
return log('NATS::$prefix $msg'.replaceAll(RegExp('\n'), '␍').replaceAll(RegExp('\r'), '␊'));
}
}