class Metanorma::Utils::Log

def add(category, loc, msg, severity: 2, display: true)

severity: 0: abort; 1: serious; 2: not serious; 3: info only
def add(category, loc, msg, severity: 2, display: true)
  @novalid || suppress_log?(category, severity, msg) and return
  @log[category] ||= []
  item = create_entry(loc, msg, severity)
  @log[category] << item
  loc = loc.nil? ? "" : "(#{current_location(loc)}): "
  suppress_display?(category, loc, msg, display) or
    warn "#{category}: #{loc}#{msg}"
end