mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
logtail: add const DefaultHost with default server name
This commit is contained in:
parent
1a0f6fea58
commit
c726c1eec9
@ -19,6 +19,10 @@
|
||||
"tailscale.com/logtail/backoff"
|
||||
)
|
||||
|
||||
// DefaultHost is the default host name to upload logs to when
|
||||
// Config.BaseURL isn't provided.
|
||||
const DefaultHost = "log.tailscale.io"
|
||||
|
||||
type Logger interface {
|
||||
// Write logs an encoded JSON blob.
|
||||
//
|
||||
@ -71,7 +75,7 @@ type Config struct {
|
||||
|
||||
func Log(cfg Config) Logger {
|
||||
if cfg.BaseURL == "" {
|
||||
cfg.BaseURL = "https://log.tailscale.io"
|
||||
cfg.BaseURL = "https://" + DefaultHost
|
||||
}
|
||||
if cfg.HTTPC == nil {
|
||||
cfg.HTTPC = http.DefaultClient
|
||||
|
Loading…
Reference in New Issue
Block a user