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
Many people may have requirement of customized output delimiter (like output should be comma or some-delimiter separated)
It make parsing of logs easier and they can be simply analyzed by using basic linux command (without using any third party software to write in a specific format and then using a log parser or analyzer library to see those logs).
Can we have a feature in go-logging library for customized output by changing output delimiter.
Many people may have requirement of customized output delimiter (like output should be comma or some-delimiter separated)
It make parsing of logs easier and they can be simply analyzed by using basic linux command (without using any third party software to write in a specific format and then using a log parser or analyzer library to see those logs).
Can we have a feature in
go-logging
library for customized output by changing output delimiter.Is it currently possible?
Yes, but not through standard fmt.Fprintf function
In function
(r *Record) Message() string
https://github.com/op/go-logging/blob/master/logger.go#L69,go-logging
uses fmt.Fprintf (which utilizes custom input format) and fmt.Fprintln (where delimiter is hard-coded to' '
inside golang source codehttps://github.com/golang/go/blob/4555ed2e5ef029cafb8040710537f0ebffd41ad6/src/fmt/print.go#L1141)
So, fmt package won't help us here.
How is possible?
By making a customized function and initial configuration
so we can have an initializer function like
and while writing to file
we can use the following function as suggested here
This would be very helpful if implemented in the library
If you want I can make pull request and make the changes for you.
Please let me know.
The text was updated successfully, but these errors were encountered: