mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 19:29:57 +00:00
TUN-7126: Add Management logger io.Writer
This commit is contained in:
40
management/events.go
Normal file
40
management/events.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package management
|
||||
|
||||
// LogEventType is the way that logging messages are able to be filtered.
|
||||
// Example: assigning LogEventType.Cloudflared to a zerolog event will allow the client to filter for only
|
||||
// the Cloudflared-related events.
|
||||
type LogEventType int
|
||||
|
||||
const (
|
||||
Cloudflared LogEventType = 0
|
||||
HTTP LogEventType = 1
|
||||
TCP LogEventType = 2
|
||||
UDP LogEventType = 3
|
||||
)
|
||||
|
||||
func (l LogEventType) String() string {
|
||||
switch l {
|
||||
case Cloudflared:
|
||||
return "cloudflared"
|
||||
case HTTP:
|
||||
return "http"
|
||||
case TCP:
|
||||
return "tcp"
|
||||
case UDP:
|
||||
return "udp"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
// LogLevel corresponds to the zerolog logging levels
|
||||
// "panic", "fatal", and "trace" are exempt from this list as they are rarely used and, at least
|
||||
// the the first two are limited to failure conditions that lead to cloudflared shutting down.
|
||||
type LogLevel string
|
||||
|
||||
const (
|
||||
Debug LogLevel = "debug"
|
||||
Info LogLevel = "info"
|
||||
Warn LogLevel = "warn"
|
||||
Error LogLevel = "error"
|
||||
)
|
Reference in New Issue
Block a user