Skip to content

Instantly share code, notes, and snippets.

@MFlisar
Last active December 20, 2021 08:08
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/a876e75d45dfb44d5abf3a4ec4aade50 to your computer and use it in GitHub Desktop.
Save MFlisar/a876e75d45dfb44d5abf3a4ec4aade50 to your computer and use it in GitHub Desktop.
Lumberjack - Setup Example
// 1) plant the console logging tree
L.plant(ConsoleTree())
// 2) plant a file logging tree
val setup = FileLoggingSetup.Setup(logsToKeep = 1, fileExtension = "txt")
val fileLoggingSetup = FileLoggingSetup.DateFiles(context, setup)
// alternatively use number file names instead of date based file names if desired
// val fileLoggingSetup = FileLoggingSetup.NumberedFiles(context, setup)
L.plant(FileLoggingTree(fileLoggingSetup))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment