From f5ccddb52b0aa7943c9c1421814435ce91f82e7d Mon Sep 17 00:00:00 2001 From: Arksine Date: Wed, 19 May 2021 08:23:24 -0400 Subject: [PATCH] file_manager: add support for an optional "logs" root This root may be used to store log files for Klipper, Moonraker, and other applications as necessary. Signed-off-by: Eric Callahan --- moonraker/components/file_manager.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/moonraker/components/file_manager.py b/moonraker/components/file_manager.py index 8caadf4..ddc2d93 100644 --- a/moonraker/components/file_manager.py +++ b/moonraker/components/file_manager.py @@ -100,6 +100,14 @@ class FileManager: raise config.error( "Option 'config_path' is not a valid directory") + # Register logs path + log_path = config.get('log_path', None) + if log_path is not None: + ret = self.register_directory('logs', log_path) + if not ret: + raise config.error( + "Option 'log_path' is not a valid directory") + # If gcode path is in the database, register it if gc_path: self.register_directory('gcodes', gc_path)