)]}'
{
  "commit": "a8a82069d68618942fdf7b7f8ce31f95ef7548ee",
  "tree": "505cdb89f0dafb5bc974d7831219da00a37c2763",
  "parents": [
    "90441aadfde6070f685adbbbfd917947cd17b261"
  ],
  "author": {
    "name": "tfarina",
    "email": "tfarina@chromium.org",
    "time": "Sun Oct 19 16:38:03 2014 -0700"
  },
  "committer": {
    "name": "Commit bot",
    "email": "commit-bot@chromium.org",
    "time": "Sun Oct 19 16:38:03 2014 -0700"
  },
  "message": "Do not forget to call `defer glog.Flush()`in our applications.\n\nI did a little experiment to verify if this call was or not necessary.\n\nThe experiment was:\n\n$ go get github.com/golang/glog\n\nWithout Flush() call:\n$ cat example1.go\npackage main\nimport \"flag\"\nimport \"github.com/golang/glog\"\nfunc main() {\n  flag.Parse()\n  glog.Infoln(\"Prepare to repel boarders\")\n}\n$ mkdir log\n$ go run example1.go -log_dir\u003d./log\n\nThen take a look at the log files under ./log dir. You won\u0027t see the message \"Prepare to repel boarders\" there.\n\nWith Flush() call:\n$ cat example2.go\npackage main\nimport \"flag\"\nimport \"github.com/golang/glog\"\nfunc main() {\n  flag.Parse()\n  defer glog.Flush()\n  glog.Infoln(\"Prepare to repel boarders\")\n}\n$ mkdir log2\n$ go run example2.go -log_dir\u003d./log2\n\nNow look at the log files under ./log2 dir, you should see the \"Prepare to repel boarders\" message there.\n\nSo in order to properly store the log messages of your server applications we need to add the call `defer glog.Flush()` to them.\n\nAlso the documentation in https://godoc.org/github.com/golang/glog state that pretty clear with the following phrase: \"Programs should call Flush before exiting to guarantee all log output is written.\"\n\nThe above experiment/finding is also available and documented at https://github.com/tfarina/rsc/tree/master/go/golang_glog.\n\nBUG\u003dNone\nTEST\u003dsee above\nR\u003djcgregorio@google.com\n\nReview URL: https://codereview.chromium.org/659943006\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3b23b3161c47f6e0b40804b5695b035521126f64",
      "old_mode": 33188,
      "old_path": "golden/go/skiacorrectness/main.go",
      "new_id": "77d733894ac1c11b056b410c678eb2be49081eab",
      "new_mode": 33188,
      "new_path": "golden/go/skiacorrectness/main.go"
    },
    {
      "type": "modify",
      "old_id": "e4cbe7750f5fee25103d3d7e3995893778119133",
      "old_mode": 33188,
      "old_path": "monitoring/go/grains/grains.go",
      "new_id": "2e0562d266512436e901302d9bef97b5e13078dc",
      "new_mode": 33188,
      "new_path": "monitoring/go/grains/grains.go"
    },
    {
      "type": "modify",
      "old_id": "1add8210e37e0a60b8024c7ba7e9f6d1e35bcfb6",
      "old_mode": 33188,
      "old_path": "monitoring/go/prober/main.go",
      "new_id": "76b4af1f1ae216323a638b1dea2724dffacc31fe",
      "new_mode": 33188,
      "new_path": "monitoring/go/prober/main.go"
    },
    {
      "type": "modify",
      "old_id": "a8118d63bbafb55add9c72ee99f3d904a28ba4b6",
      "old_mode": 33188,
      "old_path": "perf/go/ingest/main.go",
      "new_id": "edd136658f0c74b8b96caef0f317d3acf380bef1",
      "new_mode": 33188,
      "new_path": "perf/go/ingest/main.go"
    },
    {
      "type": "modify",
      "old_id": "683a1682a1313d7243e5679953eb434cf923f57d",
      "old_mode": 33188,
      "old_path": "perf/go/logserver/main.go",
      "new_id": "8d0c1aaa998e28b24ecb72a61ba7ff656c366039",
      "new_mode": 33188,
      "new_path": "perf/go/logserver/main.go"
    },
    {
      "type": "modify",
      "old_id": "99e999c02d81ac3ce677e491174e26c60316495a",
      "old_mode": 33188,
      "old_path": "perf/go/perf_migratedb/main.go",
      "new_id": "1018b9079eaee9b1fc09690f18bf3df388da0a39",
      "new_mode": 33188,
      "new_path": "perf/go/perf_migratedb/main.go"
    },
    {
      "type": "modify",
      "old_id": "475fda88a0c15bee6804701395da5f6abc1db7e1",
      "old_mode": 33188,
      "old_path": "perf/go/skiaperf/main.go",
      "new_id": "0ca72ae89a89c36f151d5f4727de8890730d7641",
      "new_mode": 33188,
      "new_path": "perf/go/skiaperf/main.go"
    }
  ]
}
