diff --git a/src/posthog-core.ts b/src/posthog-core.ts index 0a999e62a..56d4a2f67 100644 --- a/src/posthog-core.ts +++ b/src/posthog-core.ts @@ -430,8 +430,10 @@ export class PostHog { // global debug to be true Config.DEBUG = Config.DEBUG || this.config.debug if (Config.DEBUG) { - // eslint-disable-next-line no-console - console.log('[PostHog.js] Starting in debug mode', this) + logger.info('Starting in debug mode', { + this: this, + config: { ...this.config }, + }) } this._sync_opt_out_with_persistence() @@ -1733,6 +1735,11 @@ export class PostHog { } if (this.config.debug) { Config.DEBUG = true + logger.info('set_config', { + config, + oldConfig, + newConfig: { ...this.config }, + }) } this.sessionRecording?.startIfEnabledOrStop() diff --git a/src/posthog-persistence.ts b/src/posthog-persistence.ts index 9524f8682..f24d31a1f 100644 --- a/src/posthog-persistence.ts +++ b/src/posthog-persistence.ts @@ -60,6 +60,9 @@ export class PostHogPersistence { this.name = parseName(config) this.storage = this.buildStorage(config) this.load() + if (config.debug) { + logger.info('Persistence loaded', this.props) + } this.update_config(config, config) this.save() }