Helper DSL module for emitting log entries with data.
Emits a logs entry with a message, and data attached to
Struct
Value
Object
Object
Emits a logs entry with a message, and data attached to
Log.info &.emit("Program started") # No data, same as Log.info { "Program started" } Log.info &.emit("User logged in", user_id: 42) # With entry data Log.info &.emit(action: "Logged in", user_id: 42) # Empty string message, only data Log.error exception: ex, &.emit("Oopps", account: {id: 42}) # With data and exception
© 2012–2020 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.35.1/Log/Emitter.html