The design
We are going to separate the design into two sections. The first section will be the logger profile section that will contain the types that will do the actual logging of the messages to a storage medium, or display them. The second section will be the logger section that will contain the types that the applications interface with. The logger types will determine the log level of the message and then pass the message to the appropriate logger profiles to log the message. Let's start off by looking at the logger profile section.
We will begin the logger profile design by creating a protocol named LoggerProfile. This protocol will define the interface that the logger profiles will present, and any type that conforms to this protocol ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access