Fix log level reactivity.

Misc fixes and tweaks
This commit is contained in:
Lea Anthony 2020-10-12 23:36:37 +11:00
commit 082e695c83
No known key found for this signature in database
GPG key ID: 33DAF7BB90A58405
5 changed files with 7 additions and 7 deletions

View file

@ -67,7 +67,7 @@
Example Code
</div>
{#if showCode}
<Highlight class="allow-select" language="{lang}" {code} style="max-height: 500px;"/>
<Highlight class="allow-select" language="{lang}" {code}/>
{/if}
</div>
</div>

View file

@ -19,7 +19,7 @@
</script>
<div data-wails-no-drag class={$darkMode ? "codeblock" : "codeblock-light"}>
<Highlight class="allow-select" language="{lang}" {code} style="margin: -5px; max-height: 500px; font-size: 13px"/>
<Highlight class="allow-select" language="{lang}" {code} style="margin: -5px; font-size: 13px"/>
</div>
<style>

View file

@ -39,7 +39,7 @@
<div class="logging-form">
<form data-wails-no-drag class="mw-full">
<div class="form-group">
<label for="Debug">Select Log Method</label>
<div>Select Log Method</div>
{#each loglevels as option, index}
{#if index === $logLevel}
<span style="margin-top: 5px; height: 20px; display: inline-block;"><hr style="width: 270px;display: inline-block; vertical-align: middle; margin-right: 10px"/> Current Log Level </span>

View file

@ -33,7 +33,7 @@ ERROR | I am an Error message
WARN | I am a Warning message
</FakeTerm>
<br/>
Custom loggers may be given to your Wails application. More details <Link href="https://www.google.com">here</Link>.
Custom loggers may be given to your Wails application. More details <Link href="https://wails.app">here</Link>.
<br/><br/>

View file

@ -19,11 +19,11 @@
let logLevelUpper = loglevelText.toUpperCase();
let logLevelNumber = Log.Level[logLevelUpper];
setLogLevelMethod(logLevelNumber);
logLevel.set(logLevelNumber);
};
$: lang = isJs ? 'Javascript' : 'Go';
let description = `You can set the log level using Log.SetLogLevel(). It accepts a log level (number) but the log levels supported have been added to Log: Log.TRACE
`;
let description = `You can set the log level using Log.SetLogLevel(). It accepts a log level (number) but there are consts available which may be used. See example code for more details.`;
$: testcodeJs = "import { Log } from '@wails/runtime';\nLog.SetLogLevel(Log.Level." + loglevelText.toUpperCase() + ");";
$: testcodeGo = 'import "github.com/wailsapp/wails/v2/pkg/logger"\n\n// runtime is given through WailsInit()\nruntime.Log.SetLogLevel(logger.' + loglevelText.toUpperCase() + ')';
</script>
@ -33,7 +33,7 @@
<form data-wails-no-drag class="mw-full">
<!-- Radio -->
<div class="form-group">
<label for="Debug">Select Logging Level</label>
<div>Select Logging Level</div>
{#each options as option}
<div class="custom-radio">
<input type="radio" name="logging" bind:group="{loglevelText}" id="{id}-{option}" value="{option}">