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

log feature logs inotify events about log file #316

Open
TLINDEN opened this issue Feb 13, 2025 · 2 comments
Open

log feature logs inotify events about log file #316

TLINDEN opened this issue Feb 13, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@TLINDEN
Copy link

TLINDEN commented Feb 13, 2025

The --log feature can be used to generate some debugging output, which is very nice.

However, it also creates hundreds of thousands of lines per second like this:

[00:00:07.014] (741c68e006c0) INFO   File changed: "/home/scip/dev/play/gitu.log"
[00:00:07.014] (741c68e006c0) TRACE  inotify event: Event { wd: WatchDescriptor { id: 1, fd: (Weak) }, mask: MODIFY, cookie: 0, name: Some("gitu.log") }

So, it seems to what itself.

The logfile should not be monitored or exempted from logging.

best regards,
Tom

@TLINDEN
Copy link
Author

TLINDEN commented Feb 13, 2025

I'm no rust guy, but I suspect this line: https://github.com/altsem/gitu/blob/master/src/file_watcher.rs#L31 checks if a watched file is part of the .gitignore file. But even if I put gitu.log into gitignore, these logs still appear.

@altsem
Copy link
Owner

altsem commented Feb 13, 2025

Ah, that's horrible! I played around with the gitignore file but couldn't quite make sense of it and the file watcher.

However, I did hard-code it to always ignore the log-file, which does seem to work.
It seems the inotify lib was logging "Trace" logs regardless if a file was being watched, so bumped the log-level to "Debug".

Now there should be less spam, as well as a version 0.28.1! 🥳

@altsem altsem added the bug Something isn't working label Feb 13, 2025
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