ipn,log: add logger for sockstat deltas

Signed-off-by: Will Norris <will@tailscale.com>
Co-authored-by: Melanie Warrick <warrick@tailscale.com>
This commit is contained in:
Will Norris
2023-03-07 16:22:23 -08:00
committed by Will Norris
parent 5e8a80b845
commit a1d9f65354
8 changed files with 278 additions and 8 deletions

View File

@@ -192,9 +192,9 @@ func (l logWriter) Write(buf []byte) (int, error) {
return len(buf), nil
}
// logsDir returns the directory to use for log configuration and
// LogsDir returns the directory to use for log configuration and
// buffer storage.
func logsDir(logf logger.Logf) string {
func LogsDir(logf logger.Logf) string {
if d := os.Getenv("TS_LOGS_DIR"); d != "" {
fi, err := os.Stat(d)
if err == nil && fi.IsDir() {
@@ -478,7 +478,7 @@ func NewWithConfigPath(collection, dir, cmdName string) *Policy {
}
if dir == "" {
dir = logsDir(earlyLogf)
dir = LogsDir(earlyLogf)
}
if cmdName == "" {
cmdName = version.CmdName()