logger: add wrapper to options #174

Closed
opened 2023-01-25 23:35:02 +03:00 by vtolstov · 0 comments
vtolstov commented 2023-01-25 23:35:02 +03:00 (Migrated from github.com)
  • specify wrappers as logger.Option
  • if wrapper have called method - run it before original logger method
  • if wrapper does not have called method - run original logger method
  • implement wrapper that based on some ctx value override logger level - to be able to see debug logs for specific request or specific user ip (remote host addr). wrapper contains two parts - one is wrapper for server subscriber and for server handler that injects some stuff to ctx, another - logger wrapper that returns calls not logger.V method, but logger.VContext(ctx, logger.Level)
- specify wrappers as logger.Option - if wrapper have called method - run it before original logger method - if wrapper does not have called method - run original logger method - implement wrapper that based on some ctx value override logger level - to be able to see debug logs for specific request or specific user ip (remote host addr). wrapper contains two parts - one is wrapper for server subscriber and for server handler that injects some stuff to ctx, another - logger wrapper that returns calls not logger.V method, but logger.VContext(ctx, logger.Level)
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: unistack-org/micro#174
No description provided.