Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jschwietert/35c3d81078a178a38122fcf44b295338 to your computer and use it in GitHub Desktop.
Save jschwietert/35c3d81078a178a38122fcf44b295338 to your computer and use it in GitHub Desktop.
Formatting exception strings with VictorOps unified logging and class-level log variables.
- .getOrElse(Future.failed(s”Unable to locate webhook [org=$orgSlug] [incidentId=$incidentId] [policy=$policySlug]”))
// prints: Unable to locate webhook [org=victorops] [incidentId=1234] [policy=yolo]
+ .getOrElse(Future.failed(log.format(“Unable to locate webhook”)))
// prints: Unable to locate webhook :: [org=victorops] [incidentId=1234] [policy=yolo]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment