xenia icon indicating copy to clipboard operation
xenia copied to clipboard

Automatically compress log file

Open zemzema opened this issue 7 years ago • 4 comments

It would be a good option that on the end Xenia automatically compress log file that can be submitted to the compatibility list issue page.

zemzema avatar May 14 '18 19:05 zemzema

And upload to paste.ee or similar service?

Zekken01 avatar May 19 '18 01:05 Zekken01

What type of format would be best for this? targz? tarxz? zip? 7z? RAR? In order for this to get done, this would need to be decided on. I would be glad to implement this once it actually gets decided.

techflashYT avatar May 28 '22 07:05 techflashYT

Sounds like it would be an easy first issue, but the problem I see here is that in order for it to be useful, it needs to be done in real time.

What type of format would be best for this? targz? tarxz? zip? 7z? RAR? In order for this to get done, this would need to be decided on. I would be glad to implement this once it actually gets decided.

It's a bit more challenging than it seems in my opinion, because you would need to compress the file in real time so to speak. You can't just have it auto zip something and then delete the original log file, because it would add a considerable delay to exiting.

However, as a suggestion I would say .ZIP should be decided here since it has native support in practically every operating system and does pretty well with compressing text. I am open for ideas on how this should be done as well.

Nonary avatar May 31 '22 05:05 Nonary

Alright, well if it's ZIP, I have kind of a suggestion on how it should work. A kind of checklist of possible ways. Here's some psuedocode:

#ifdef __linux  || ifdef MAC // *nix based
    if (gzip exists) {
        gzip(log)
        return
    }
    else if (tar exists) {
        tar(log)
        return
    }
    else {
        compressUsingBuiltInMethodFromLibrary(log)
        return
    }
#elifdef WIN32 // Windows
    if (7zip) {
        7zip(log, "zip")
        return
    }
    else if (winrar) {
        winrar(log, "zip")
        return
    }
    else if (builtInWindowsZipTool) {
        builtInWindowsZipTool(log)
        return
    }
    else if (powershell) {
        powershellWithCompress-ArchiveArgumen(log)
        return
    }
    else {
        compressUsingBuiltInMethodFromLibrary(log)
        return
   }
#else // Something else, we don't know what it has, so just use builtin method
    compressUsingBuiltinMethodFromLibrary(log)
#endif

techflashYT avatar Jun 02 '22 00:06 techflashYT