FAQ
Hello,

Thanks for releasing golang/glog. When using the --log_dir flag with a
relative path, such as:

$ ./bin/index --log_dir=out/log

The helper symlinks (eg: *.INFO) are created incorrectly. For example:

$ ls -l out/log/index.*
-rw-r--r-- 1 ahochhaus ahochhaus 820851 Jul 18 16:02
out/log/index.ahochhaus-pc.ahochhaus.log.INFO.20130718-160008.30243
lrwxrwxrwx 1 ahochhaus ahochhaus 67 Jul 18 16:00 out/log/index.INFO ->
out/log/index.ahochhaus-pc.ahochhaus.log.INFO.20130718-160008.30243

To resolve correctly, the symlink should not include the relative path but
only the file name (as the symlink itself and the file being linked to are
in the same directory).

Thanks,
-Andy

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Hochhaus, Andrew at Oct 7, 2013 at 4:51 pm
    From the glang/glog README I understand that the master copy of the
    repository lives inside Google, not on github so I should not send a pull
    request. This two line change fixes the creation of symlinks when
    specifying relative --log_dir. Would someone who has access to the internal
    repository be willing to consider applying this?

    diff --git a/src/github.com/golang/glog/glog_file.go b/src/
    github.com/golang/glog/glog_file.go
    index 8dcb2bc..65075d2 100644
    --- a/src/github.com/golang/glog/glog_file.go
    +++ b/src/github.com/golang/glog/glog_file.go
    @@ -114,8 +114,8 @@ func create(tag string, t time.Time) (f *os.File,
    filename string, err error) {
                     f, err := os.Create(fname)
                     if err == nil {
                             symlink := filepath.Join(dir, link)
    - os.Remove(symlink) // ignore err
    - os.Symlink(fname, symlink) // ignore err
    + os.Remove(symlink) // ignore err
    + os.Symlink(name, symlink) // ignore err
                             return f, fname, nil
                     }
                     lastErr = err

    Thanks,
    -Andy

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • David Symonds at Oct 8, 2013 at 12:12 am
    I'll take a look.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • David Symonds at Oct 8, 2013 at 9:23 pm
    https://github.com/golang/glog/commit/20cea4dfef0c0151bba0422a6244cc1d3e8292b1

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJul 18, '13 at 8:14p
activeOct 8, '13 at 9:23p
posts4
users2
websitegolang.org

2 users in discussion

Hochhaus, Andrew: 2 posts David Symonds: 2 posts

People

Translate

site design / logo © 2022 Grokbase