Design a Logging Framework
Medium · Low-Level Design · about 40 minutes
Asked at Microsoft, Amazon, Google, Adobe, Grammarly, Electronic Arts, Unity.
Design a logging library like log4j or Python's logging. Code gets a named logger and logs messages at levels DEBUG, INFO, WARN, ERROR. Each logger has a minimum level; messages are formatted and written to one or more destinations (console, file, remote). Logging must be safe from many threads and must not slow callers down.