diff --git a/src/core/logging.scala b/src/core/logging.scala index 888d3ba..4177cd0 100644 --- a/src/core/logging.scala +++ b/src/core/logging.scala @@ -38,6 +38,7 @@ case class Realm private(name: Text): object Level: given Ordering[Level] = Ordering[Int].on[Level](_.ordinal) given Communicable[Level] = level => Message(level.show.upper) + given Show[Level] = _.toString.tt.upper enum Level: case Fine, Info, Warn, Fail diff --git a/src/syslog/syslog.scala b/src/syslog/syslog.scala index 0d86475..5a3c74b 100644 --- a/src/syslog/syslog.scala +++ b/src/syslog/syslog.scala @@ -20,12 +20,15 @@ import guillotine.* import rudiments.* import parasite.* import anticipation.* +import gossamer.* import turbulence.* import perforate.* case class Syslog(tag: Text) object Syslog: + given LogFormat[Syslog] = entry => + t"[${entry.level}] ${entry.realm}: ${entry.message}\n" given (using Monitor): Appendable[Syslog, Text] = (syslog, stream) => safely: