Skip to content

Commit 893dee3

Browse files
authored
Feature: set log level via settings UI
Signed-off-by: Robin Windey <[email protected]>
1 parent ca5ae4e commit 893dee3

16 files changed

+121
-17
lines changed

css/logreader-main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/Splitter-7c596d5a.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/*! third party licenses: js/vendor.LICENSE.txt */
2+
import{g as d}from"./logreader-main.mjs";function h(r,c){for(var s=0;s<c.length;s++){const t=c[s];if(typeof t!="string"&&!Array.isArray(t)){for(const a in t)if(a!=="default"&&!(a in r)){const e=Object.getOwnPropertyDescriptor(t,a);e&&Object.defineProperty(r,a,e.get?e:{enumerable:!0,get:()=>t[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var g=function(r){for(var c=0,s=1,t=2,a=3,e=c,i=0,b=null,o=[],n=0;n<r.length;++n)switch(e){case c:switch(r[n]){case"{":++i,e=s,b=n;break}break;case s:switch(r[n]){case"{":++i;break;case"}":--i,i===0&&(e=c,o.push({start:b,end:n+1}));break;case'"':e=t;break}break;case t:switch(r[n]){case'"':e=s;break;case"\\":e=a;break}break;case a:e=t;break}var f={jsons:[],remainder:r.substring(o[o.length-1].end)};return o.forEach(function(u){f.jsons.push(r.substring(u.start,u.end))}),f};const k=d(g),p=h({__proto__:null,default:k},[g]);export{p as S};
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/Splitter-9140b094.mjs

Lines changed: 0 additions & 2 deletions
This file was deleted.

js/logreader-main.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

js/logreader-main.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Constants.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ class Constants {
3232
* Used AppConfig Keys
3333
*/
3434
public const CONFIG_KEY_SHOWNLEVELS = 'shownLevels';
35+
public const CONFIG_KEY_LOGLEVEL = 'logLevel';
3536
public const CONFIG_KEY_DATETIMEFORMAT = 'dateTimeFormat';
3637
public const CONFIG_KEY_RELATIVEDATES = 'relativedates';
3738
public const CONFIG_KEY_LIVELOG = 'liveLog';
3839
public const CONFIG_KEYS = [
3940
self::CONFIG_KEY_SHOWNLEVELS,
41+
self::CONFIG_KEY_LOGLEVEL,
4042
self::CONFIG_KEY_DATETIMEFORMAT,
4143
self::CONFIG_KEY_RELATIVEDATES,
4244
self::CONFIG_KEY_LIVELOG

lib/Controller/SettingsController.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,13 @@ public function updateAppConfig(string $settingsKey, $settingsValue): JSONRespon
9292
}
9393
}
9494

95-
// Set on DB
96-
$this->config->setAppValue($this->appName, $settingsKey, json_encode($settingsValue));
95+
if ($settingsKey === Constants::CONFIG_KEY_LOGLEVEL) {
96+
// Set backend loglevel directly via system value
97+
$this->config->setSystemValue('loglevel', $settingsValue);
98+
} else {
99+
// Set on DB
100+
$this->config->setAppValue($this->appName, $settingsKey, json_encode($settingsValue));
101+
}
97102

98103
return new JSONResponse();
99104
}

lib/Service/SettingsService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public function getLiveLog(): bool {
6565
public function getAppSettings(): array {
6666
return [
6767
Constants::CONFIG_KEY_SHOWNLEVELS => $this->getShownLevels(),
68+
Constants::CONFIG_KEY_LOGLEVEL => $this->config->getSystemValueInt('loglevel', 0),
6869
Constants::CONFIG_KEY_DATETIMEFORMAT => $this->getDateTimeFormat(),
6970
Constants::CONFIG_KEY_RELATIVEDATES => $this->getRelativeDates(),
7071
Constants::CONFIG_KEY_LIVELOG => $this->getLiveLog(),

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)