PSR-3 implementation, extracted from my melting codebase.