mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-28 05:39:57 +00:00
TUN-3470: Replace in-house logger calls with zerolog
This commit is contained in:

committed by
Adam Chalmers

parent
06404bf3e8
commit
870f5fa907
35
vendor/github.com/rs/zerolog/encoder_cbor.go
generated
vendored
Normal file
35
vendor/github.com/rs/zerolog/encoder_cbor.go
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
// +build binary_log
|
||||
|
||||
package zerolog
|
||||
|
||||
// This file contains bindings to do binary encoding.
|
||||
|
||||
import (
|
||||
"github.com/rs/zerolog/internal/cbor"
|
||||
)
|
||||
|
||||
var (
|
||||
_ encoder = (*cbor.Encoder)(nil)
|
||||
|
||||
enc = cbor.Encoder{}
|
||||
)
|
||||
|
||||
func appendJSON(dst []byte, j []byte) []byte {
|
||||
return cbor.AppendEmbeddedJSON(dst, j)
|
||||
}
|
||||
|
||||
// decodeIfBinaryToString - converts a binary formatted log msg to a
|
||||
// JSON formatted String Log message.
|
||||
func decodeIfBinaryToString(in []byte) string {
|
||||
return cbor.DecodeIfBinaryToString(in)
|
||||
}
|
||||
|
||||
func decodeObjectToStr(in []byte) string {
|
||||
return cbor.DecodeObjectToStr(in)
|
||||
}
|
||||
|
||||
// decodeIfBinaryToBytes - converts a binary formatted log msg to a
|
||||
// JSON formatted Bytes Log message.
|
||||
func decodeIfBinaryToBytes(in []byte) []byte {
|
||||
return cbor.DecodeIfBinaryToBytes(in)
|
||||
}
|
Reference in New Issue
Block a user