earthit/logging

Simple callback-based logging infrastructure

Installs: 4 270

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 5

Forks: 0

Open Issues: 0

pkg:composer/earthit/logging

1.1.1 2017-01-05 21:05 UTC

This package is auto-updated.

Last update: 2025-09-20 06:39:14 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.