-
Notifications
You must be signed in to change notification settings - Fork 814
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
Write logs to local, not config dir #3868
Conversation
Fixes nextcloud#3406 Signed-off-by: Miha Frangež <[email protected]>
AppImage file: Nextcloud-PR-3868-a09a4bf3333e6c29b52ff824b3b51f2ad34813fe-x86_64.AppImage |
Cool, thank you :) will you be able to test it on Windows and macOS aswell? |
Yes, but I'm still setting up toolchains on both. Should have results in a few hrs EDIT: yeah, that was optimistic, some things came up... 😅 |
OK, I marked it as a draft pr. Feel free to request a review from me, @mgallien, @allexzander and @camilasan if it's ready, and mark it then as ready for review. |
@@ -951,7 +951,7 @@ void ConfigFile::setAutomaticLogDir(bool enabled) | |||
|
|||
QString ConfigFile::logDir() const | |||
{ | |||
const auto defaultLogDir = QString(configPath() + QStringLiteral("/logs")); | |||
const auto defaultLogDir = QString(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QStringLiteral("/logs")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@franga2000 I'd say, you need to change the corresponding part in QString ConfigFile::configPath() const
if you want to only affect Linux. There is certain logic in QString ConfigFile::configPath() const
that gets executed for Windows. Better try not to change the behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Affecting other platforms was intentional, as discussed here: #3406 (comment).
As far as I can tell, configPath()
only handles Windows differently because QStandardPaths::AppConfigLocation
somewhat strangely resolves to AppData\Local
. But AppLocalDataLocation
resolves "reasonably" on Windows (according to the conventions I know). The rest of the login in the function moves config files from a legacy location, which doesn't interfere with this change either.
Given that, do you still prefer I leave Windows as it was before (logs alongside configs in AppData\Roaming
)?
I haven't been able to build this to test on Windows or macOS as I only have VMs of them and everything takes ages to install. Any chance someone with a working build environment could give this a quick test (or at least compile and send it to me)? |
Hello, Thank you for your contribution to the Desktop Client with this pull request. We truly value your support and hope to see more contributions from you in the future! Best regards, |
As discussed in #3406
Tested: