SingleFile

class SingleFile(val folder: String = getDefaultLogFolder(), val fileName: String = DEFAULT_FILE_BASE_NAME, val fileExtension: String = DEFAULT_FILE_EXTENSION, maxFileSizeInBytes: Int = DEFAULT_MAX_FILE_SIZE_IN_BYTES, trimFactor: Float = 0.5f) : FileLoggerSetup

Writes all logs to a single file.

When the file reaches maxFileSizeInBytes, it is trimmed instead of creating archive files. Approximately the newest trimFactor portion of the file is kept.

Defaults:

  • fileName = "log"

  • fileExtension = "txt"

  • maxFileSizeInBytes = 5 MB

  • trimFactor = 0.5 (keep roughly 50%)

Constructors

Link copied to clipboard
constructor(folder: String = getDefaultLogFolder(), fileName: String = DEFAULT_FILE_BASE_NAME, fileExtension: String = DEFAULT_FILE_EXTENSION, maxFileSizeInBytes: Int = DEFAULT_MAX_FILE_SIZE_IN_BYTES, trimFactor: Float = 0.5f)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val fileBaseName: String
Link copied to clipboard
open override val fileConverter: FileConverter
Link copied to clipboard
open override val fileExtension: String
Link copied to clipboard
Link copied to clipboard
open override val folder: String
Link copied to clipboard
val path: Path

Functions

Link copied to clipboard
open suspend override fun deleteAllLogFiles()
Link copied to clipboard
open override fun filterFilesToDelete(files: List<Path>): List<Path>
Link copied to clipboard
open override fun getActiveLogFilePath(event: FileLogger.Event.Log): Path
Link copied to clipboard
open override fun getAllExistingLogFilePaths(): List<Path>
Link copied to clipboard
open override fun getAllLogFiles(sorted: Boolean): List<Path>
Link copied to clipboard
open override fun getLatestLogFilePath(): Path?
Link copied to clipboard
open override fun getRollOverType(currentPath: Path?, event: FileLogger.Event.Log): BaseFileLoggerSetup.RollOverType