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

[BREAKING] Replace npmlog with @ui5/logger/Logger #363

Merged
merged 3 commits into from
Jan 17, 2023
Merged

Conversation

RandomByte
Copy link
Member

@RandomByte RandomByte commented Jan 16, 2023

Remove the usage of npmlog and refactor @ui5/logger modules to emit log
events which are then caught in dedicated handlers. This is somewhat
inspired by npm's proc-log module.

Internally, there are additional logger-classes for certain use cases.
Like updating status information on start/end of a project or -task
build. This allows handlers to create metrics on the build progress and,
for example, render a progress bar.

All of this should make @ui5/logger more future-proof. Thanks to the
decoupling of log-message creation and -handling, multiple instances and
versions of @ui5/logger can interoperate with each other.

BREAKING CHANGE:
This version of @ui5/logger is not compatible with previous versions. For example, messages logged through version 2 might disturb the progress bar rendering of this version. Future version updates however are expected to be compatible.

JIRA: CPOUI5FOUNDATION-603

@coveralls
Copy link

coveralls commented Jan 16, 2023

Coverage Status

Coverage: 99.457% (-0.5%) from 100.0% when pulling 2f79dba on logger-v3 into 4994aa4 on main.

Remove the usage of npmlog and refactor @ui5/logger moduels to emit log
events which are then catched in dedicated handlers. This is somewhat
inspired by npm's proc-log module.

Internally, there are additional logger-classes for certain use cases.
Like updating status information on start/end  of a project or -task
build. This allows handlers to reate metrics on the build progress and,
for example, render a progress bar.

All of this should make @ui5/logger more future-proof. Thanks to the
decoupling of log-message creation and -handling, multiple intances and
versions of @ui5/logger can interoperate with each other.
@RandomByte RandomByte force-pushed the logger-v3 branch 2 times, most recently from ea11147 to d07b33a Compare January 17, 2023 09:43
lib/handlers/ConsoleHandler.js Show resolved Hide resolved
lib/handlers/ConsoleHandler.js Show resolved Hide resolved
lib/loggers/Logger.js Outdated Show resolved Hide resolved
lib/loggers/Logger.js Show resolved Hide resolved
@RandomByte RandomByte merged commit 66a159a into main Jan 17, 2023
@RandomByte RandomByte deleted the logger-v3 branch January 17, 2023 13:09
RandomByte added a commit to SAP/ui5-project that referenced this pull request Jan 17, 2023
RandomByte added a commit to SAP/ui5-cli that referenced this pull request Jan 17, 2023
RandomByte added a commit to SAP/ui5-project that referenced this pull request Jan 17, 2023
RandomByte added a commit to SAP/ui5-cli that referenced this pull request Jan 17, 2023
RandomByte added a commit to SAP/ui5-project that referenced this pull request Jan 17, 2023
RandomByte added a commit to SAP/ui5-builder that referenced this pull request Jan 17, 2023
SAP/ui5-logger#363 made logger modules more
restrictive.

* XMLCompositeAnalyzer must provide a module name to create a logger
  instance
* generateLibraryPreload integration tests need to be executed in
  sequence to prevent issues with the stateful BuildLogger
RandomByte added a commit to SAP/ui5-project that referenced this pull request Jan 18, 2023
RandomByte added a commit to SAP/ui5-cli that referenced this pull request Jan 18, 2023
RandomByte added a commit to SAP/ui5-project that referenced this pull request Jan 19, 2023
RandomByte added a commit to SAP/ui5-cli that referenced this pull request Jan 19, 2023
RandomByte added a commit to SAP/ui5-cli that referenced this pull request Jan 19, 2023
RandomByte added a commit to SAP/ui5-builder that referenced this pull request Jan 19, 2023
SAP/ui5-logger#363 made logger modules more
restrictive.

* XMLCompositeAnalyzer must provide a module name to create a logger
  instance
* generateLibraryPreload integration tests need to be executed in
  sequence to prevent issues with the stateful BuildLogger
Copy link

@KlattG KlattG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

d3xter666 pushed a commit to SAP/ui5-project that referenced this pull request Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants