@crimsonsunset/jsg-logger 1.8.5 → 1.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to the JSG Logger project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.8.6] - 2026-03-28 🪵 **configure() console feedback**
9
+
10
+ ### Changed
11
+ - **`configure()` now logs applied config** — after merging the partial config, `configure()` emits a `"JSG Logger configured"` log entry showing `projectName`, `components`, and `timestampMode`. Previously the one-time init log fired at module evaluation time with default values, making it impossible to visually confirm that `configure()` had applied a consumer's `projectName` and other settings.
12
+
13
+ ---
14
+
8
15
  ## [1.8.5] - 2026-03-28 🏷️ **configure() TypeScript types**
9
16
 
10
17
  ### Added
package/index.d.ts CHANGED
@@ -235,7 +235,11 @@ export interface JSGLogger {
235
235
  * Update config on an already-initialized singleton without reinitializing.
236
236
  * Merges the provided partial config into the running instance, preserving all
237
237
  * registered transports. Use this instead of getInstanceSync(config) when the
238
- * singleton may already be initialized (e.g. by module-level auto-init).
238
+ * singleton may already be initialized by module-level auto-init.
239
+ *
240
+ * Emits a "JSG Logger configured" log showing the applied projectName and
241
+ * component count, so the final config is visible in the console even though
242
+ * the one-time init log already fired with defaults at module evaluation time.
239
243
  *
240
244
  * If the singleton has not yet been initialized, behaves like getInstanceSync(config).
241
245
  *
@@ -244,7 +248,7 @@ export interface JSGLogger {
244
248
  *
245
249
  * @example
246
250
  * ```ts
247
- * // instrumentation-client.ts — configure project name + display before anything uses the logger
251
+ * // instrumentation-client.ts — run before anything else uses the logger
248
252
  * JSGLogger.configure({ projectName: 'My App', display: { timestamp: true } });
249
253
  * ```
250
254
  */
package/index.js CHANGED
@@ -999,8 +999,9 @@ class JSGLogger {
999
999
  /**
1000
1000
  * Update logger configuration post-initialization without reinitializing.
1001
1001
  * Merges partialConfig into the current config without touching registered transports.
1002
- * Transports can only be registered at init time — this method cannot add or remove them.
1003
1002
  * If called before any initialization has occurred, delegates to getInstanceSync(partialConfig).
1003
+ * Emits a "JSG Logger configured" log so the applied project config is visible in the
1004
+ * console even though the one-time init log already fired with defaults at module eval time.
1004
1005
  * @param {Object} partialConfig - Partial config to merge into the current config
1005
1006
  * @returns {Object} Enhanced logger exports
1006
1007
  */
@@ -1016,6 +1017,19 @@ class JSGLogger {
1016
1017
  JSGLogger._instance.transports = currentTransports;
1017
1018
  JSGLogger._instance.refreshLoggers();
1018
1019
 
1020
+ // Re-log init summary so consumers can see the applied project config.
1021
+ // The module-level auto-init fires before configure() can run, meaning
1022
+ // the one-time init log always shows defaults. This follow-up makes
1023
+ // the final configured state visible in the console.
1024
+ if (JSGLogger._instance.loggers?.core) {
1025
+ const components = configManager.getAvailableComponents();
1026
+ JSGLogger._instance.loggers.core.info('JSG Logger configured', {
1027
+ projectName: configManager.getProjectName(),
1028
+ components: components.length,
1029
+ timestampMode: configManager.getTimestampMode(),
1030
+ });
1031
+ }
1032
+
1019
1033
  return JSGLogger._enhancedLoggers;
1020
1034
  }
1021
1035
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crimsonsunset/jsg-logger",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "type": "module",
5
5
  "description": "Multi-environment logger with smart detection, file-level overrides, and beautiful console formatting. Test it live: https://logger.joesangiorgio.com/",
6
6
  "main": "index.js",