Skip to content

Commit 6b9d7f7

Browse files
authored
glog: populate symlinks -log_link directory (#64)
This was reported in https://groups.google.com/g/golang-nuts/c/Fh9o3CPjIIw/m/TyiUDY2uAAAJ.
1 parent 03ad3c2 commit 6b9d7f7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

glog_file.go

+5
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ func create(tag string, t time.Time) (f *os.File, filename string, err error) {
132132
symlink := filepath.Join(dir, link)
133133
os.Remove(symlink) // ignore err
134134
os.Symlink(name, symlink) // ignore err
135+
if *logLink != "" {
136+
lsymlink := filepath.Join(*logLink, link)
137+
os.Remove(lsymlink) // ignore err
138+
os.Symlink(fname, lsymlink) // ignore err
139+
}
135140
return f, fname, nil
136141
}
137142
lastErr = err

0 commit comments

Comments
 (0)