Skip to content

Add lightweight PSR-3 implementation #179

@roxblnfk

Description

@roxblnfk

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestfor contributorsYou don't need to dive deep to implement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions