Added helper function and log level mapping.