Sija/raven.cr

Support Log class

Sija opened this issue · 0 comments

Sija commented

Log class (introduced in Crystal version 0.34.0) is a total rewrite of the old Logger class (now deprecated) - which raven has supported by means of automagically recording logged messages as breadcrumbs - see:

private def write(severity, datetime, progname, message)
record_breadcrumb(
severity,
datetime,
self.class.deansify(progname),
self.class.deansify(message),
)
previous_def
end

This integration needs to be reworked now in order to support the new Log class - preferably as a custom Log::Backend.

Some of the things to keep in mind:

  • Usage of Logger#progname needs to be changed to use Log#source instead
  • Having Raven::Logger class might prove redundant
  • Having wildcard support for excluded source names (db.*) would be nice
  • Raven::CrashHandler needs to be updated accordingly
  • Old Logger breadcrumb integration would need to stay until Logger class is finally removed from Crystal's stdlib

Refs #64