From df66b46785a6f604a3f4c1a955b6097fb86bc179 Mon Sep 17 00:00:00 2001 From: Henrik Fuchs Date: Sat, 15 Apr 2023 13:15:12 +0200 Subject: [PATCH] fix: remove "Elm" prefix from log messages --- src/Common.ts | 4 ++-- src/ElmComponent.ts | 4 ++-- src/useElmish.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Common.ts b/src/Common.ts index 71b799c..e704322 100644 --- a/src/Common.ts +++ b/src/Common.ts @@ -2,8 +2,8 @@ import { Services } from "./Init"; import { Cmd, Dispatch, Message } from "./Types"; function logMessage (name: string, msg: TMessage): void { - Services.logger?.info("Elm", "message from", name, msg.name); - Services.logger?.debug("Elm", "message from", name, msg); + Services.logger?.info("Message from", name, msg.name); + Services.logger?.debug("Message from", name, msg); Services.dispatchMiddleware?.(msg); } diff --git a/src/ElmComponent.ts b/src/ElmComponent.ts index 741c62a..00986aa 100644 --- a/src/ElmComponent.ts +++ b/src/ElmComponent.ts @@ -40,7 +40,7 @@ abstract class ElmComponent extends Re const [model, ...commands] = fakeOptions?.model ? [fakeOptions.model as TModel] : init(this.props); - Services.logger?.debug("Elm", "initial model for", name, model); + Services.logger?.debug("Initial model for", name, model); this.componentName = name; this.currentModel = model; @@ -111,7 +111,7 @@ abstract class ElmComponent extends Re this.reentered = false; if (this.mounted && modified) { - Services.logger?.debug("Elm", "update model for", this.componentName, this.currentModel); + Services.logger?.debug("Update model for", this.componentName, this.currentModel); this.forceUpdate(); } } diff --git a/src/useElmish.ts b/src/useElmish.ts index 8d206ba..d0bf010 100644 --- a/src/useElmish.ts +++ b/src/useElmish.ts @@ -112,7 +112,7 @@ function useElmish ({ name, props, ini setModel(prevModel => { const updatedModel = { ...prevModel as TModel, ...currentModel }; - Services.logger?.debug("Elm", "update model for", name, updatedModel); + Services.logger?.debug("Update model for", name, updatedModel); return updatedModel; }); @@ -126,7 +126,7 @@ function useElmish ({ name, props, ini initializedModel = initModel; setModel(initializedModel); - Services.logger?.debug("Elm", "initial model for", name, initializedModel); + Services.logger?.debug("Initial model for", name, initializedModel); execCmd(dispatch, ...initCommands); }