A class representing a logging level.
CIT Logger is a library that extends the library CIT Messaging with an API for logging.
This library mainly provides an abstraction for logging and not so much logging itself. This means that you will either have to use an existing extension of it, or build your own, in order to use it in a real scenario.
To use this library, you need to understand the concepts provided. So here follows an overview of the concepts.
Loggeris an implementation of
Messagingthat provides methods for logging.
Levelis a class that represents a logging level without any naming restrictions.
LoggerConfiguratoris a mechanism that allows you to configure a
Loggerin numerous ways.
Messageimplementation used as the message in a log by this API.
The following example demonstrates how you can use this library.
The above example demonstrates the fact that a
Logger logger = Logger.newInstance(); logger.getMessageChannel().addMessageChannelObserver((messageChannel, message) -> System.out.printf("%s%n", message)); logger.start(); logger.info("Hello, World!");
Loggeris nothing more than an empty shell by default. But it's flexible and allows you to configure it in many different ways. However, most of the time, you're just interested in getting that
Logger, so you can log whatever it is that you want to log. You don't want to spend a lot of time configuring it every now and then. It's good, then, that we've taken care of that for you.
getInstance(String) will delegate the responsibility of configuring to the current
LoggerConfigurator. But only the first time, when