Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ebhsgit opened this issue Dec 27, 2019 · 1 comment
Open

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

ebhsgit opened this issue Dec 27, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@ebhsgit
Copy link

ebhsgit commented Dec 27, 2019

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;
@ebhsgit ebhsgit changed the title removeFile() function does not work [BUG] removeFile() function does not work Dec 27, 2019
@y-a-n-n
Copy link
Contributor

y-a-n-n commented Jan 3, 2020

Thanks for the report! We're likely to be doing some maintenance work on this repo in the near future, so we'll look into it then

@y-a-n-n y-a-n-n added the bug Something isn't working label Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants