Skip to content

[BUG] removeFile() function does not work #11

@ebhsgit

Description

@ebhsgit

Plugin version: 2.0.7
OS: Android 9 (Real device, and emulator)

Description
When there are many log files, the log files are not automatically removed.
The following error is written to the log file

SEVERE ERROR: could not clean up old files. [object Object]

This is because removeFile() always fails

Expected behaviour
Old log files are deleted as expected.

Detail
Upon investigating the code, I suspect the filePath used is invalid.

   private removeFile(entry: Entry): Promise<any> {
        this.debug_metaLog('Removing file: ' + entry.fullPath);
        const fullPath = entry.fullPath;
        const path = fullPath.replace(entry.name, '');   // THIS IS THE PROBLEM
        return this.file.removeFile(this.config.baseDir + path, entry.name);
    }

I believe the fix should be to use the log directory

  const path = this.config.logDir;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions