Skip to content

Commit 20cea4d

Browse files
committed
Create a relative symlink for log files.
This matches what C++ does in practice, and permits this code to work if -log_dir is a relative path.
1 parent c6f9652 commit 20cea4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

glog_file.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ func create(tag string, t time.Time) (f *os.File, filename string, err error) {
114114
f, err := os.Create(fname)
115115
if err == nil {
116116
symlink := filepath.Join(dir, link)
117-
os.Remove(symlink) // ignore err
118-
os.Symlink(fname, symlink) // ignore err
117+
os.Remove(symlink) // ignore err
118+
os.Symlink(name, symlink) // ignore err
119119
return f, fname, nil
120120
}
121121
lastErr = err

0 commit comments

Comments
 (0)