mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-09 08:01:31 +00:00
logpolicy: automatically figure out paths and filenames.
The autoselection should pick sensible paths for all of: - Windows (LocalAppData) - Mac (Library/Caches) - Unix user (XDG_CACHE_DIR) - Linux systemd service (CACHE_DIRECTORY) As a last resort, if cache dir lookup fails, plops sufficiently uniquely named files into the current working directory. Signed-off-by: David Anderson <dave@natulte.net>
This commit is contained in:

committed by
Dave Anderson

parent
bec17d05cb
commit
15b4d26d92
@@ -66,7 +66,7 @@ func main() {
|
||||
log.Printf("Warning: no --tun device specified; routing disabled.\n")
|
||||
}
|
||||
|
||||
pol := logpolicy.New("tailnode.log.tailscale.io", *config)
|
||||
pol := logpolicy.New("tailnode.log.tailscale.io")
|
||||
|
||||
logf := wgengine.RusagePrefixLog(log.Printf)
|
||||
|
||||
|
@@ -31,7 +31,7 @@ func main() {
|
||||
if *config == "" {
|
||||
log.Fatal("no --config file specified")
|
||||
}
|
||||
pol := logpolicy.New("tailnode.log.tailscale.io", *config)
|
||||
pol := logpolicy.New("tailnode.log.tailscale.io")
|
||||
defer pol.Close()
|
||||
|
||||
cfg, err := loadConfig(*config)
|
||||
|
@@ -59,7 +59,7 @@ func main() {
|
||||
nopf := getopt.BoolLong("no-packet-filter", 'F', "disable packet filter")
|
||||
advroutes := getopt.ListLong("routes", 'r', "routes to advertise to other nodes (comma-separated, e.g. 10.0.0.0/8,192.168.1.0/24)")
|
||||
getopt.Parse()
|
||||
pol := logpolicy.New("tailnode.log.tailscale.io", "tailscale")
|
||||
pol := logpolicy.New("tailnode.log.tailscale.io")
|
||||
if len(getopt.Args()) > 0 {
|
||||
log.Fatalf("too many non-flag arguments: %#v", getopt.Args()[0])
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ func main() {
|
||||
if err != nil {
|
||||
logf("fixConsoleOutput: %v\n", err)
|
||||
}
|
||||
pol := logpolicy.New("tailnode.log.tailscale.io", "tailscaled")
|
||||
pol := logpolicy.New("tailnode.log.tailscale.io")
|
||||
|
||||
getopt.Parse()
|
||||
if len(getopt.Args()) > 0 {
|
||||
|
Reference in New Issue
Block a user