-
Notifications
You must be signed in to change notification settings - Fork 30
Feature: set log level via settings UI #1027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| /*! third party licenses: js/vendor.LICENSE.txt */ | ||
| 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}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| <template> | ||
| <fieldset> | ||
| <legend>{{ t('logreader', 'Set backend loglevel') }}</legend> | ||
| <NcCheckboxRadioSwitch v-for="levelName, levelId in LOGGING_LEVEL_NAMES" | ||
| :key="levelId" | ||
| :checked="logLevel" | ||
| :value="`${levelId}`" | ||
| type="radio" | ||
| name="loglevel" | ||
| @update:checked="setLogLevel"> | ||
| {{ levelName }} | ||
| </NcCheckboxRadioSwitch> | ||
| </fieldset> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import type { IAppSettings } from '../../interfaces' | ||
|
|
||
| import { computed } from 'vue' | ||
| import { showError } from '@nextcloud/dialogs' | ||
| import { translate as t } from '@nextcloud/l10n' | ||
| import { useSettingsStore } from '../../store/settings' | ||
| import { logger } from '../../utils/logger' | ||
| import { LOGGING_LEVEL_NAMES } from '../../constants' | ||
|
|
||
| import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js' | ||
|
|
||
| const settingsStore = useSettingsStore() | ||
|
|
||
| /** | ||
| * Get currently set loglevel | ||
| */ | ||
| const logLevel = computed(() => `${settingsStore.logLevel}`) | ||
|
|
||
| const setLogLevel = (level: string) => { | ||
| const numericLevel = parseInt(level) as IAppSettings['logLevel'] | ||
| settingsStore.setSetting('logLevel', numericLevel) | ||
| .catch(e => { | ||
| showError(t('logreader', 'Could not set logging level')) | ||
| logger.error(e as Error) | ||
| }) | ||
| } | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| fieldset { | ||
| padding: 6px; | ||
| } | ||
| </style> |
Uh oh!
There was an error while loading. Please reload this page.