The LoggerTrait provides implementations for logging messages across various log levels, simplifying the logging
process by delegating to a single log() method. It defines several methods corresponding to different severity
levels, as outlined by the PSR-3 specification for logging:
emergency(): Logs when the system is unusable.
alert(): Logs when action must be taken immediately.
critical(): Logs critical conditions
error(): Logs runtime errors that do not require immediate action but should be monitored.
warning(): Logs exceptional occurrences that are not errors.
notice(): Logs normal but significant events.
info(): Logs informational messages for general operational information.
debug(): Logs detailed debugging information for developers.
Each method accepts a string or Stringable message and an optional context array, then calls the log() method with
the corresponding log level.
The log() method is abstract and must be implemented by the using class. It ensures flexibility, allowing the
actual logging implementation to define how to handle different log levels. Additionally, it throws a
LogArgumentException if invalid arguments are passed.
This trait standardizes logging behavior and promotes code reuse, enabling consistent logging practices throughout
the application.