Skip to content

Commit

Permalink
Showing 3 changed files with 8 additions and 33 deletions.
27 changes: 0 additions & 27 deletions logtail/id.go

This file was deleted.

9 changes: 5 additions & 4 deletions logtail/logtail.go
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ import (
"tailscale.com/net/interfaces"
"tailscale.com/net/sockstats"
tslogger "tailscale.com/types/logger"
"tailscale.com/types/logid"
"tailscale.com/util/set"
"tailscale.com/wgengine/monitor"
)
@@ -49,8 +50,8 @@ type Encoder interface {

type Config struct {
Collection string // collection name, a domain name
PrivateID PrivateID // private ID for the primary log stream
CopyPrivateID PrivateID // private ID for a log stream that is a superset of this log stream
PrivateID logid.PrivateID // private ID for the primary log stream
CopyPrivateID logid.PrivateID // private ID for a log stream that is a superset of this log stream
BaseURL string // if empty defaults to "https://log.tailscale.io"
HTTPC *http.Client // if empty defaults to http.DefaultClient
SkipClientTime bool // if true, client_time is not written to logs
@@ -189,7 +190,7 @@ type Logger struct {
uploadCancel func()
explainedRaw bool
metricsDelta func() string // or nil
privateID PrivateID
privateID logid.PrivateID
httpDoCalls atomic.Int32

procID uint32
@@ -222,7 +223,7 @@ func (l *Logger) SetLinkMonitor(lm *monitor.Mon) {
// PrivateID returns the logger's private log ID.
//
// It exists for internal use only.
func (l *Logger) PrivateID() PrivateID { return l.privateID }
func (l *Logger) PrivateID() logid.PrivateID { return l.privateID }

// Shutdown gracefully shuts down the logger while completing any
// remaining uploads.
5 changes: 3 additions & 2 deletions logtail/logtail_test.go
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ import (
"time"

"tailscale.com/tstest"
"tailscale.com/types/logid"
)

func TestFastShutdown(t *testing.T) {
@@ -299,15 +300,15 @@ func TestPublicIDUnmarshalText(t *testing.T) {
const hexStr = "6c60a9e0e7af57170bb1347b2d477e4cbc27d4571a4923b21651456f931e3d55"
x := []byte(hexStr)

var id PublicID
var id logid.PublicID
if err := id.UnmarshalText(x); err != nil {
t.Fatal(err)
}
if id.String() != hexStr {
t.Errorf("String = %q; want %q", id.String(), hexStr)
}
err := tstest.MinAllocsPerRun(t, 0, func() {
var id PublicID
var id logid.PublicID
if err := id.UnmarshalText(x); err != nil {
t.Fatal(err)
}

0 comments on commit 7e4788e

Please sign in to comment.