You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> go run main.go 4
factorial: 4 enter
factorial: 4 3 enter
factorial: 4 3 2 enter
factorial: 4 3 2 1 enter
factorial: 4 3 2 1 exit
factorial: 4 3 2 exit
factorial: 4 3 exit
factorial: 4 exit
24
> go run main.go -10
factorial: -10 enter
factorial: -10 is negative!
factorial: -10 exit
0
I implemented this: https://gist.github.com/jbenet/70ff524c460986eab6c3 which does what I want. (extracted from go-ipfs). BUT, the issue is the filename breaks, because op/go-logging assumes the runtime calldepth is at a particular place in the stack, and that its logger is not being wrapped.
So, if not wrapping, then it has to be done within a logging.Logger.
could wrap a Backend? can't get the logger's current backend, and the Record's fields are private.
could wrap the Formatter? the logger is not associated with a formatter. see backend.
Suggestions?
The text was updated successfully, but these errors were encountered:
Suppose I have a logger, and i want to prefix its output. Pseudo example:
I implemented this: https://gist.github.com/jbenet/70ff524c460986eab6c3 which does what I want. (extracted from go-ipfs). BUT, the issue is the filename breaks, because op/go-logging assumes the runtime calldepth is at a particular place in the stack, and that its logger is not being wrapped.
So, if not wrapping, then it has to be done within a
logging.Logger
.Backend
? can't get the logger's current backend, and theRecord
's fields are private.Formatter
? the logger is not associated with a formatter. see backend.Suggestions?
The text was updated successfully, but these errors were encountered: