require 'json' class Object def to_semlogger [self.class.name.to_sym, self.respond_to?( :serializable_hash) ? self.serializable_hash : self ] end end class Exception def to_semlogger [:exception] + super end end class String def to_semlogger [:String, self] end end %w[Numeric FalseClass TrueClass NilClass].each do |cl| Object.const_get( cl).class_eval do def to_semlogger [:const, self] end end end class Semlogger < ::Logger class CustomType def initialize name, *obj @name, @obj = name.to_s.to_sym, obj end def to_semlogger [@name] + @obj end end attr_accessor :logdev, :level, :progname class <