Skip to content

Conversation

@pastamoe
Copy link
Contributor

@pastamoe pastamoe commented Nov 2, 2025

Description

Add an option to set rclone's log-level per mount:

programs.rclone.remotes.<name>.mounts.<name>.logLevel = "DEBUG";

If no value is set, it'll use rclone's implicit default ("NOTICE")

Previously, the debug log-level got enforced (via "-vv"), which caused noisy logs, and there was no easy way to change that.

Note: rclone global-flags can't be configured in the config file. So, this uses the environment variable approach.

references:

Checklist

  • Change is backwards compatible.

  • Code formatted with nix fmt or
    nix-shell -p treefmt nixfmt deadnix keep-sorted --run treefmt.

  • Code tested through nix run .#tests -- test-all or
    nix-shell --pure tests -A run.all.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.
    • Generate a news entry. See News
    • Basic tests added. See Tests
  • If this PR adds an exciting new feature or contains a breaking change.

    • Generate a news entry. See News

@github-actions github-actions bot added the backup label Nov 2, 2025
@home-manager-ci home-manager-ci bot requested a review from ttrssreal November 2, 2025 01:49
@pastamoe
Copy link
Contributor Author

pastamoe commented Nov 2, 2025

Side note: there are no tests for this module yet, so I didn't "modify" any. But I tested the behavior of this change on my machine.

[EDIT] I found the standalone tests now, but I'm not sure how to cover this yet

Copy link
Collaborator

@khaneliman khaneliman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change makes sense to me, as long as @ttrssreal doesn't have any concerns.

@ttrssreal
Copy link
Contributor

Can we move the new option to the mounts submodule? as its specific to the mount systemd services.

@pastamoe
Copy link
Contributor Author

pastamoe commented Nov 2, 2025

Can we move the new option to the mounts submodule? as its specific to the mount systemd services.

Good point! I'll move it

@pastamoe
Copy link
Contributor Author

pastamoe commented Nov 2, 2025

Moved the option and updated the commit/PR description.
I also changed the default log level to "NOTICE", as that's what rclone would use when no setting is given, and "INFO" is still a bit too spammy for normal operations IMO.

WDYT?

@pastamoe pastamoe force-pushed the rclone-log-level branch 2 times, most recently from 8b96288 to abcf8a2 Compare November 2, 2025 14:35
@khaneliman
Copy link
Collaborator

imo I'd prefer most settings that have an application default behavior don't have a configuration default so that a user gets the default app behavior.

@pastamoe
Copy link
Contributor Author

pastamoe commented Nov 2, 2025

imo I'd prefer most settings that have an application default behavior don't have a configuration default so that a user gets the default app behavior.

So, should I remove default=..., and if no value is set, the "RCLONE_LOG_LEVEL" shouldn't be put inside the service definition? Am I getting this right?

Copy link
Collaborator

@khaneliman khaneliman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something like this

@ttrssreal
Copy link
Contributor

I agree with @khaneliman about using the application default here. Looks good otherwise, logging should definitely be configurable. Thanks for the PR!

@khaneliman khaneliman self-requested a review November 2, 2025 16:49
@pastamoe pastamoe changed the title rclone: add option to set log-level, use info as default rclone: add option to set log-level Nov 2, 2025
pastamoe and others added 2 commits November 2, 2025 23:16
Add an option to set rclone's log-level per mount:
programs.rclone.remotes.<name>.mounts.<name>.logLevel = "DEBUG";
If no value is set, it'll use rclone's implicit default ("NOTICE")

Previously, the debug log-level got enforced (via "-vv"),
which caused noisy logs, and there was no easy way to change that.

Note: rclone global-flags can't be configured in the config file,
so this uses the environment variable approach.

references:
- https://rclone.org/docs/#logging
- https://rclone.org/docs/#v-vv-verbose
If no value is given, use the implicit default of rclone instead of redefining it through the options

Co-authored-by: Austin Horstman <[email protected]>
@pastamoe
Copy link
Contributor Author

pastamoe commented Nov 2, 2025

Thx for the support! I applied the suggestions of @khaneliman and updated commit and PR description (also removed the mention of the default from the title, to prevent confusion later on)

@khaneliman khaneliman merged commit 371608e into nix-community:master Nov 3, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants