diff options
Diffstat (limited to 'code/app/src/help/persistent-store.ts')
| -rw-r--r-- | code/app/src/help/persistent-store.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/code/app/src/help/persistent-store.ts b/code/app/src/help/persistent-store.ts index 6a54282..cb12547 100644 --- a/code/app/src/help/persistent-store.ts +++ b/code/app/src/help/persistent-store.ts @@ -1,6 +1,7 @@ import {browser} from "$app/environment"; import {writable as _writable, readable as _readable} from "svelte/store"; import type {Writable, Readable, StartStopNotifier} from "svelte/store"; +import { log_debug, log_info } from "./logger"; enum StoreType { SESSION = 0, @@ -76,11 +77,11 @@ function subscribe<T>(store: Writable<T> | Readable<T>, options: WritableStore<T function writable_persistent<T>(options: WritableStore<T>): Writable<T> { if (!browser) { - console.warn("Persistent store is only available in the browser"); + log_info("WARN: Persistent store is only available in the browser"); return; } if (options.options === undefined) options.options = default_store_options; - console.log("Creating writable store with options: ", options); + log_debug("creating writable store with options: ", options); const store = _writable<T>(options.initialState); hydrate(store, options); subscribe(store, options); @@ -89,11 +90,11 @@ function writable_persistent<T>(options: WritableStore<T>): Writable<T> { function readable_persistent<T>(options: ReadableStore<T>): Readable<T> { if (!browser) { - console.warn("Persistent store is only available in the browser"); + log_info("WARN: Persistent store is only available in the browser"); return; } if (options.options === undefined) options.options = default_store_options; - console.log("Creating readable store with options: ", options); + log_debug("Creating readable store with options: ", options); const store = _readable<T>(options.initialState, options.callback); // hydrate(store, options); subscribe(store, options); |
