Course Content
Data Structures & Algorithms
Full Stack Web Development
Understanding and playing with DOM (Document Object Model)
0/2
MERN project
0/2
Low Level System Design
LLD Topics
High Level System Design
Fast-Track to Full Spectrum Software Engineering
Explanation of Each Class

Logger

 

  • Central class that the developer uses.
  • Manages the current log level, formatter, and output handler.
  • Filters messages and sends them to appropriate destination.

 

LogHandler (Abstract or Interface)

 

  • Defines the method write() for outputting logs.
  • Concrete implementations:
      • FileHandler: Writes logs to a file.

      • ConsoleHandler: Prints logs to the terminal.

 

Formatter

 

  • Formats log messages with timestamps, levels, etc.
  • Can be extended for custom formatting (e.g., JSON format).

 

LogLevel

 

  • Enum or constants defining severity levels.
  • Used by Logger to determine which messages to process.


How to Teach This

  • Explain how separation of concerns is maintained through handlers and formatters.
  • Use examples to show how a developer can plug in different formatters or handlers.
  • Emphasize extensibility, where more handlers like RemoteHandler or DatabaseHandler can be added later.
0% Complete
WhatsApp Icon

Hi Instagram Fam!
Get a FREE Cheat Sheet on System Design.

Hi LinkedIn Fam!
Get a FREE Cheat Sheet on System Design

Loved Our YouTube Videos? Get a FREE Cheat Sheet on System Design.