diff --git a/kotlinlog/src/main/kotlin/quanti/com/kotlinlog/file/FileLogger.kt b/kotlinlog/src/main/kotlin/quanti/com/kotlinlog/file/FileLogger.kt index ca8b4c1..87f9468 100644 --- a/kotlinlog/src/main/kotlin/quanti/com/kotlinlog/file/FileLogger.kt +++ b/kotlinlog/src/main/kotlin/quanti/com/kotlinlog/file/FileLogger.kt @@ -133,6 +133,17 @@ class FileLogger( companion object { + /** + * Deletes all stored logs in app local memory + */ + fun deleteLogsForIdentifier(appCtx: Context, logIdentifier: String) { + appCtx + .logFilesDir + .listFiles() + .filter { it.name.contains(logIdentifier) } + .filter { it.name.endsWith(".log") } + .forEach { it.delete() } + } /** * Deletes all stored logs in app local memory */