earthit / logging
Simple callback-based logging infrastructure
Installs: 4 262
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 0
Open Issues: 0
Requires
- php: >=5.2
Requires (Dev)
- phpunit/phpunit: ~3.7
This package is auto-updated.
Last update: 2024-11-20 05:03:46 UTC
README
This is an exceedingly simple framework for logging arbitrary events.
A logger is simply a function that is called with a single argument, which is a representation of the event to be logged. The only constraint is that said log event should be either a string or an object that supports __toString.
One event class is predefined, EarthIT_Logging_AnnotatedEvent. This wraps another log event and associated metadata such as log level or begin and end times, which your logging function may look at.
A LogHelperGears
trait is defind that makes it easier to
create and log EarthIT_Logging_AnnotatedEvents by calling
$this->debug(...)
, $this->log(...)
, or $this->warn(...)
.
A few basic logging classes are provided, also.