output method
void
output(})
colorful print
Implementation
void output(String body, {
String head = '', String tail = '',
required String tag, required LogCaller caller,
}) {
int size = body.length;
if (0 < limitLength && limitLength < size) {
body = '${body.substring(0, limitLength - 4)} ...';
size = limitLength;
}
String x;
// print chunks
int start = 0, end = chunkLength;
for (; end < size; start = end, end += chunkLength) {
x = head + body.substring(start, end) + tail + carriageReturn;
println(x, tag: tag, caller: caller);
}
if (start > 0) {
// print last chunk
x = head + body.substring(start) + tail;
} else {
// too short, print the whole message
x = head + body + tail;
}
println(x, tag: tag, caller: caller);
}