Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(utils): configurable logger using webpack infrastructure logger #355

Merged
merged 3 commits into from
Oct 31, 2022

Conversation

pavandv
Copy link
Contributor

@pavandv pavandv commented Oct 30, 2022

Usage:

In the webpack plugin#apply method, extract infrastructure logger and set it to the logger constructor

import type { Compiler } from 'webpack';
import { Logger } from '@module-federation/utilities';

class SomePlugin {
  apply(compiler: Compiler) {
    this.logger = Logger.setLogger(
      compiler.getInfrastructureLogger(PLUGIN_NAME)
    );

    // somewhere else in the plugin
    this.logger.log("do the log here");
  }
}

closes #243

@pavandv pavandv added ✨ enhancement New feature or request Utilities Utilities Package labels Oct 30, 2022
@pavandv pavandv self-assigned this Oct 30, 2022
@ScriptedAlchemy ScriptedAlchemy merged commit d6ffcd0 into main Oct 31, 2022
@ScriptedAlchemy ScriptedAlchemy deleted the feat/custom-logger branch October 31, 2022 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request Utilities Utilities Package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

configurable logger to send logs instead of console.XX
2 participants