-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure file logging works #3601
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @karampok)
go/lib/log/log_test.go, line 34 at r1 (raw file):
}() testcases := map[string]struct {
CamelCase would be testCases
here.
go/lib/log/log_test.go, line 44 at r1 (raw file):
"can create, nil": { dir: "/tmp/aka/should/exist",
It's cleaner to namespace test filesystem side effects under a temporary directory. See https://golang.org/pkg/io/ioutil/#TempDir.
So steps would be:
- create temp dir at start of test
- use any path underneath it instead of
dir
for the test case - remove the temp dir entirely in the defer at the end of the test
fad2cbb
to
252b046
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 3 files reviewed, 2 unresolved discussions (waiting on @scrye)
go/lib/log/log_test.go, line 34 at r1 (raw file):
Previously, scrye (Sergiu Costea) wrote…
CamelCase would be
testCases
here.
Done.
go/lib/log/log_test.go, line 44 at r1 (raw file):
Previously, scrye (Sergiu Costea) wrote…
It's cleaner to namespace test filesystem side effects under a temporary directory. See https://golang.org/pkg/io/ioutil/#TempDir.
So steps would be:
- create temp dir at start of test
- use any path underneath it instead of
dir
for the test case- remove the temp dir entirely in the defer at the end of the test
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
Our code base tries to create the log dir if does not exists. It returns an error if the above is not possible. Fixes scionproto#2340
252b046
to
5632bfe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3.
Reviewable status: complete! all files reviewed, all discussions resolved
Our code base tries to create the log dir if does not exists.
It returns an error if the above is not possible.
Removes also some convey.
Fixes #2340
This change is