MCPcopy
hub / github.com/tailscale/tailscale / ExampleServer_ignoreLogsSometimes

Function ExampleServer_ignoreLogsSometimes

tsnet/example_tsnet_test.go:97–108  ·  view source on GitHub ↗

ExampleServer_ignoreLogsSometimes shows you how to ignore all of the log messages written by a tsnet instance, but allows you to opt-into them if a command-line flag is set.

()

Source from the content-addressed store, hash-verified

95// written by a tsnet instance, but allows you to opt-into them if a command-line
96// flag is set.
97func ExampleServer_ignoreLogsSometimes() {
98 tsnetVerbose := flag.Bool("tsnet-verbose", false, "if set, verbosely log tsnet information")
99 hostname := flag.String("tsnet-hostname", "hikari", "hostname to use on the tailnet")
100
101 srv := &tsnet.Server{
102 Hostname: *hostname,
103 }
104
105 if *tsnetVerbose {
106 srv.Logf = log.New(os.Stderr, fmt.Sprintf("[tsnet:%s] ", *hostname), log.LstdFlags).Printf
107 }
108}
109
110// ExampleServer_HTTPClient shows you how to make HTTP requests over your tailnet.
111//

Callers

nothing calls this directly

Calls 2

StringMethod · 0.65
NewMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…