Skip to content

[BUG] Open log folder button gives an error / Incorrect log location #2

Description

@DavidGBrett
Image

09:01:22.4138+02:00 - ERROR - PublicAPIInstance.OpenDirectory - Failed to open folder
EXCEPTION OCCURS: System.Runtime.InteropServices.COMException (0x80070002): Failed to parse file path
at void Flow.Launcher.Infrastructure.Win32Helper.OpenFolderAndSelectFile(string filePath) in C:/projects/flow-launcher/Flow.Launcher.Infrastructure/Win32Helper.cs:line 865
at void Flow.Launcher.PublicAPIInstance.OpenDirectory(string directoryPath, string fileNameOrFilePath) in C:/projects/flow-launcher/Flow.Launcher/PublicAPIInstance.cs:line 361

The built in Open Log Location result does work correctly on my end though.

Though it seems this is referring to a different folder?

It looks like you are trying to create a Logs folder inside a Plugins folder inside the local appdata folder for flow?
This isn't somewhere you should be creating logs in directly - but regardless it doesn't look like your log is ending up there anyways.

private void OpenLogFolder()
    {
        var logFolder = Path.Combine(
            Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
            "FlowLauncher",
            "Plugins",
            "Logs");
        Directory.CreateDirectory(logFolder);
        _context?.API.OpenDirectory(logFolder, "Shorty.log");
    }

It would be bettter to log to the same log file shared by the rest of flow launcher (its in roaming not local, but you can find it with Open Log Location)
The existing API already has log methods you can use.

Probably no need to have a specific button in your settings to open the shared log file then.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions