Skip navigation links

Package org.macroing.cit.logger

Provides the API for CIT Logger.

See: Description

Package org.macroing.cit.logger Description

Provides the API for CIT Logger.

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.

Concept Overview

To use this library, you need to understand the concepts provided. So here follows an overview of the concepts.

Examples

The following example demonstrates how you can use this library.

 
 Logger logger = Logger.newInstance();
 logger.getMessageChannel().addMessageChannelObserver((messageChannel, message) -> System.out.printf("%s%n", message));
 logger.start();
 logger.info("Hello, World!");
 
 
The above example demonstrates the fact that a Logger is 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.

The methods getInstance(), getInstance(Class<?>) and getInstance(String) will delegate the responsibility of configuring to the current LoggerConfigurator. But only the first time, when they're created.

Skip navigation links