diff options
author | 2024-10-04 21:11:18 +0000 | |
---|---|---|
committer | 2024-10-23 22:14:34 +0000 | |
commit | 0597a9d7757e3753a1508981d2310e9ac92c3c43 (patch) | |
tree | a64d2108d92f85e60b73df5395c7d5f92c0a74d1 | |
parent | 8a2257965207cf117a33bc52dc9e39c94e35a343 (diff) |
Filter out the logs from inotify_buffer in edit monitor
The inotify_buffer logs every filesystem event received (in Debug level) which
pollutes the edit monitor log. This cl filters out the logs from
inotify_buffer.py to keep the log clean.
Test: make edit_monitor and test it locally
Bug: 365617369
Change-Id: Ib7951c2fd7d8cabf3f56a2cd0364c26f682ca977
-rw-r--r-- | tools/edit_monitor/main.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/edit_monitor/main.py b/tools/edit_monitor/main.py index 40574adf40..9086ac839a 100644 --- a/tools/edit_monitor/main.py +++ b/tools/edit_monitor/main.py @@ -63,6 +63,9 @@ def configure_logging(): logging.basicConfig( filename=log_path, level=logging.DEBUG, format=log_fmt, datefmt=date_fmt ) + # Filter out logs from inotify_buff to prevent log pollution. + logging.getLogger('watchdog.observers.inotify_buffer').addFilter( + lambda record: record.filename != 'inotify_buffer.py') print(f'logging to file {log_path}') |