Logger: extracted formatValue() from formatMessage()