refactor: introduce shared logger and migrate console.* across packages#3621
Open
theguriev wants to merge 1 commit into
Open
refactor: introduce shared logger and migrate console.* across packages#3621theguriev wants to merge 1 commit into
theguriev wants to merge 1 commit into
Conversation
Adds a canonical, level-gated, silenceable logger at @superdoc/common/logger and replaces ~620 raw console.* calls in shipped package source with it, so embedding SuperDoc no longer spams the host console and output is filterable and redirectable. - New @superdoc/common/logger: levels (silent/error/warn/info/debug, default warn), namespaces + child(), configurable global sink, env override (SUPERDOC_LOG_LEVEL). Console.log statements map to log.debug (silent by default); warn/error stay visible. - Migrated super-editor (~370), superdoc (~50), layout-engine layout-bridge/painters-dom/layout-engine/measuring (~99). - Consolidated existing ad-hoc loggers onto the canonical one: super-validator logger and collaboration-yjs internal-logger become thin adapters (collaboration-yjs gains @superdoc/common dep). The deprecated @superdoc-dev/ai package keeps its own logger. - eslint no-console rule for package src (logger module, deprecated ai logger and a zero-dep env-gated url-validation warning are exempt). - Updated console-spy test assertions to the namespaced output shape. Verified: full tsc -b, no-console clean repo-wide, and vitest green for super-editor (15787), superdoc (1123), layout-engine painters-dom (1179), layout-bridge (1281), measuring-dom (349), collaboration-yjs (42). The bun-test suites (@superdoc/common, layout-engine core) were not run locally (no bun) but compile clean and contain no console-spy assertions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a canonical, level-gated, silenceable logger at @superdoc/common/logger and replaces ~620 raw console.* calls in shipped package source with it, so embedding SuperDoc no longer spams the host console and output is filterable and redirectable.
Verified: full tsc -b, no-console clean repo-wide, and vitest green for super-editor (15787), superdoc (1123), layout-engine painters-dom (1179), layout-bridge (1281), measuring-dom (349), collaboration-yjs (42). The bun-test suites (@superdoc/common, layout-engine core) were not run locally (no bun) but compile clean and contain no console-spy assertions.