Add context logging constructor #252

Open
opened 2025-01-06 07:49:35 +01:00 by lash · 0 comments
Owner

For convenience, add a logger wrapper that adds the context keys to include in slog output.

e.g. something like (not tested):

package logging

type ContextLogger logging.Logger

func NewContextLogger(domain string) logging.Logger{
   var logg ContextLogger 
   logg = logging.NewVanilla().WithDomain(domain).WithContextKey("SessionId").WithContextKey("ATSessionId")
   return logg
}
For convenience, add a logger wrapper that adds the context keys to include in slog output. e.g. something like (not tested): ``` package logging type ContextLogger logging.Logger func NewContextLogger(domain string) logging.Logger{ var logg ContextLogger logg = logging.NewVanilla().WithDomain(domain).WithContextKey("SessionId").WithContextKey("ATSessionId") return logg } ```
lash added the
Kind/Enhancement
Priority
Low
refactor
support
Activity
Proposal
labels 2025-01-06 07:49:49 +01:00
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: urdt/ussd#252
No description provided.