String formatLogMessage(String msg) { if (logName != null) { return '[$logName] $msg'; } return msg; }