Exercise: Logging with Template

Practice how to create a logging component that uses template methods for logging different log levels.

Problem statement

Implement the same logging component we defined in the previous exercise, but this time using the Template pattern. We’d then obtain a ConsoleLogger class to log to the console or FileLogger class to log to a file. Appreciate the differences between the Template and the Strategy approaches.

Coding challenge

Write your solution code in the following code widget. We’ve already added the package.json file for your ease.

Get hands-on with 1200+ tech skills courses.