Logger Factory
The LoggerFactory
is a factory class that is responsible for creating loggers. It creates a new logger based on the type of the class that is requesting it.
Each factory implements the following interface:
Creating a logger
You can access the factories in the following ways:
IDisposable
Each logger needs to be disposed of when it's no longer needed. This is done by calling the Dispose
method on the logger. This will remove the logger from the LogManager
and clean up any resources that the logger is using.
Logger Factory Behaviour
The LoggerFactoryBehaviour
is a helper class that can keep track of all the loggers that are created on a GameObject
. It will dispose of all the loggers when the GameObject
is destroyed.
Injection
The LoggerFactoryBehaviour
will inject a logger into any class on the GameObject that extends IRequiresLogger
interface. This is how the LoggerBehaviour
works. You can use this to inject a logger into any class.
Factory
The LoggerFactoryBehaviour
als implements the IRabbitLoggerFactory
interface. This allows you to create loggers using the factory.
Last updated