Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 1.79 KB

migration.md

File metadata and controls

40 lines (25 loc) · 1.79 KB

Migration

This section provides an overview of breaking changes, when migrating from an older typescript-logging version.

Version 2.1.x -> 2.2.x

No breaking changes.

Version 2.0.x -> 2.1.x

Enum value LogLevel.Off has been added. It is unlikely to cause a problem to existing code, however if you do switch on LogLevel in the code somewhere and/or check on LogLevel, the compilation of your project may fail or the logic is now wrong.

To find out if you do, you can search for '.logLevel' (it is a property on a logger).

Version 1.0.x -> 2.0.x

As version 2 is a complete rewrite from scratch there is no direct migration path although certain things are still similar.

Version 2 comes with two separate flavors category-style and log4ts-style, depending on whether you used the LFService or CategoryServiceFactory, you respectively want to install typescript-logging-category-style or typescript-logging-log4ts-style. Please check out the documentation for the respective flavor for installation and all details.

The Logger and Category interfaces are mostly backwards compatible (and if not the compiler will tell you).

Breaking changes are found in the setup/configuration of each style compared to version 1.

The category-style is now set up using a CategoryProvider.createProvider(...) call, and the log4ts-style by Log4TSProvider.createProvider(...).

Custom message formatting / loggers can be provided by custom channels (see documentation).

The browser developer extension currently has no replacement, this may change if there is sufficient demand for it. Use the dynamic logging control instead (see documentation of each style).