Skip to content

Version 7

Info

Version 7.* is a kotlin multiplatform rewrite, that's why some fundamantal changes needed to be done!

Overall some things have become extension functions to provide target specific implementations. Platform specific functions and overloads have been added to provide a good single platform experience and some typos have been fixed as well.

Following is an overview on what has changed and shows how you can migrate your project.

Logger setup classes#

I do provide platform specific create function to make single platform usage easier. On android those do look like following now:

val setup = FileLoggerSetup.Daily.create(
    context, 
    fileBaseName = "log_daily"
)
val setup2 = FileLoggerSetup.FileSize.create(
    context, 
    maxFileSizeInBytes = 1000 * 10 /* 10 kB */,  
    fileBaseName = "log_size", 
    filesToKeep = 2
)

In MP projects you can simply use the classes themself if you want to.

Functions become extension functions#

To provide platform specific implementations, some functions needed to be converted to extension functions:

  • getAllExistingLogFiles (new import: import com.michaelflisar.lumberjack.core.getAllExistingLogFiles)
  • Level.priority (new import: import com.michaelflisar.lumberjack.core.classes.priority)
  • getLatestLogFiles => getLatestLogFile (also fixed a typo, new import: import com.michaelflisar.lumberjack.core.getLatestLogFile)