Skip to content

Add lightweight PSR-3 implementation #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
roxblnfk opened this issue Apr 7, 2025 · 0 comments
Open

Add lightweight PSR-3 implementation #179

roxblnfk opened this issue Apr 7, 2025 · 0 comments

Comments

@roxblnfk
Copy link
Member

roxblnfk commented Apr 7, 2025

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.

@roxblnfk roxblnfk changed the title Add PSR-3 logger implementation Add lightweight PSR-3 implementation Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant