Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
June 26, 2021 08:47 pm GMT

A Logging System

This is a small logging system based of Swift Log which is a Swift logging API package.

UML

Logging System UML

Main Components

LoggingSystem

The main faade. It can only booted once with a Logger instance.

Logger

This will call the LogHandler instance with the proper log level and other params provided by the caller.

LogHandler

A protocol which the log handlers must implement. It mainly contains a log function to pass the params.

MultiplexLogHandler

An implementation of the LogHandler protocol. Can pass the log message to other log handlers. Useful if you wish to log messages to local and remote systems using different handlers.

StreamLogHandler

An implementation of the LogHandler protocol that sends the messages to standard output or standard error.


Original Link: https://dev.to/clsource/a-logging-system-95c

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To