module MJ; module Logging; # # Basic Layout for the logging framework. # # Will prefix message according to the following list: # # WARNING => 'warning: ' # ERROR => 'error: ' # REST => '' class BasicLayout < ::Logging::Layout def format( event ) obj = format_obj(event.data) return case event.level when ::Logging::level_num(:ERROR) sprintf("error: %s\n", obj) when ::Logging::level_num(:WARN) sprintf("warning: %s\n", obj) else obj + "\n" end end end # class BasicLayout end; end