add log path entry to config
This commit is contained in:
parent
a3a4202b00
commit
0141b5e130
|
@ -73,6 +73,7 @@ class KlipperPlugin(
|
|||
),
|
||||
configuration = dict(
|
||||
path="~/printer.cfg",
|
||||
logpath="/tmp/klippy.log",
|
||||
reload_command="RESTART"
|
||||
)
|
||||
)
|
||||
|
@ -290,7 +291,7 @@ class KlipperPlugin(
|
|||
def on_api_command(self, command, data):
|
||||
if command == "listLogFiles":
|
||||
files = []
|
||||
for f in glob.glob("/tmp/*.log*"):
|
||||
for f in glob.glob(self._settings.get(["configuration", "logpath"]) + "*"):
|
||||
filesize = os.path.getsize(f)
|
||||
files.append(dict(
|
||||
name=os.path.basename(f) + " ({:.1f} KB)".format(filesize / 1000.0),
|
||||
|
|
|
@ -26,6 +26,12 @@
|
|||
<input type="text" class="input-block-level" data-bind="value: settings.settings.plugins.klipper.configuration.path">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Klipper Log Path') }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" class="input-block-level" data-bind="value: settings.settings.plugins.klipper.configuration.logpath">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ _('Configuration Reload Command') }}</label>
|
||||
<div class="controls">
|
||||
|
|
Loading…
Reference in New Issue