Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion octoprint_klipper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def get_settings_defaults(self):
),
configuration = dict(
path="~/printer.cfg",
logpath="/tmp/klippy.log",
reload_command="RESTART"
)
)
Expand Down Expand Up @@ -285,7 +286,7 @@ def get_api_commands(self):
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),
Expand Down
6 changes: 6 additions & 0 deletions octoprint_klipper/templates/klipper_settings.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down