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 Base class <