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 <arksine.code@gmail.com>
This commit is contained in:
Arksine 2021-05-19 08:23:24 -04:00
parent 94e1dcf2cb
commit f5ccddb52b
1 changed files with 8 additions and 0 deletions

View File

@ -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)