Skip to content

Instantly share code, notes, and snippets.

@MFlisar
Last active December 20, 2021 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MFlisar/b26f7e2fcb23470b33891f43275de6ae to your computer and use it in GitHub Desktop.
Save MFlisar/b26f7e2fcb23470b33891f43275de6ae to your computer and use it in GitHub Desktop.
// simple logs
L.d { "This is my first log entry" }
L.logIf { true }?.d { "This is my second log entry - it will be logged because logIf evaluates to true" }
L.logIf { false }?.d { "Slow log line without any impact at runtime - sleeping 5s: ${ Thread.sleep(5000) }"}
L.d { "Log line 3 will not slow down this code because the function inside the log will never be called because the logIf evaluates to false" }
// optionally tag a log line - tags are useful to group logs and can be disabled at runtime
L.tag("TAG1").d { "Log with tag" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment