Exercise: Logging with Template
Practice how to create a logging component that uses template methods for logging different log levels.
We'll cover the following
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 1400+ tech skills courses.