Description
Add a standalone PSR-3 implementation that works with Trap and is compatible with both fiber-based asynchronous code and synchronous execution.
Requirements
- Implementation must be self-contained without dependencies from other packages or project parts
- Must be for client-side of the project only
- Must function in both async code with fibers and synchronous code
- To detect async execution just check that
\Fiber::getCurrent() is not null
- Non-blocking mode in async case.
- Should attempt to send logs to Trap server using Monolog format first
- Fall back to STDERR in text format if connection fails
- Logger should be accessible via
trap()::logger()
Implementation Notes
The logger needs to handle both execution contexts appropriately and prioritize Trap server logging with graceful fallback to STDERR.
Description
Add a standalone PSR-3 implementation that works with Trap and is compatible with both fiber-based asynchronous code and synchronous execution.
Requirements
\Fiber::getCurrent()is not nulltrap()::logger()Implementation Notes
The logger needs to handle both execution contexts appropriately and prioritize Trap server logging with graceful fallback to STDERR.