Flogs
Flogs copied to clipboard
Missing empty fields
I'm not quite sure why there is no empty fields in exported logs. For instance, if you don't specify exception / stacktrace it returns empty string. This is bad, since you don't know which part of the logs you are missing. This is required if you want to parse logs on other system, fe. google Stackdriver.
static String _formatCurly(Log log, bool isDevelopmentDebuggingEnabled) {
String output;
if (log != null) {
output = "{${log.className}} ";
output += "{${log.methodName}} ";
output += "{${log.text}} ";
output += log.exception != 'null' ? "{${log.exception}} " : "";
output += "{${log.logLevel.toString()}} ";
output += "{${log.timestamp}} ";
output += log.stacktrace != 'null' ? "{${log.stacktrace}} " : "";
if (isDevelopmentDebuggingEnabled) {
output += !kReleaseMode ? "{${log.dataLogType}} " : "";
output += !kReleaseMode ? "{${log.timeInMillis}}" : "";
}
}
return output;
}
IMO it should return empty {}
so we can easily split each row and parse it more easily.
This could be easily configured via cfg file to keep backward compatibility.
PR for this created: https://github.com/zubairehman/Flogs/pull/21
thanks for the pull request, will review and merge soon :)
So, after over a year, I'm bumping it up :) I have created new PR. Please take a look @zubairehman . It doesn't change default behaviour, it extends it if you configure it in a different way.
https://github.com/zubairehman/Flogs/pull/53