Skip to content

cleanup: differentiate logger tags — 'core' used by 5+ unrelated modules #623

Description

@SisyphusZheng

Problem

createLogger('core') is used by 5+ modules with unrelated responsibilities:

Module Actual responsibility
packages/element/src/internal/core/island.ts Island registration
packages/element/src/internal/core/render-dsd.ts DSD rendering
packages/adapter-vite/src/internal/ssg/route-scanner.ts Route scanning
packages/adapter-vite/src/internal/ssg/postprocess.ts Build post-processing
packages/adapter-vite/src/internal/ssg/build-postprocess.ts Build post-processing
packages/adapter-vite/src/internal/ssg/island-scanner.ts Island scanning

All emit [core] ... making it impossible to identify the source in build logs or browser console.

Fix

Assign specific tags per module:

Module New tag
island.ts 'island'
render-dsd.ts 'render-dsd'
route-scanner.ts 'scanner'
postprocess.ts 'postprocess'
build-postprocess.ts 'postprocess'
island-scanner.ts 'island-scan'

Keep 'core' reserved for truly core-level messages only (e.g., errors.ts).

Acceptance

  • No more than 2 modules share the same logger tag
  • Build output logs are distinguishable by source module

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions