Add support for log rotation

When using debug level the log files tends to fill up quickly.
Add support for log rotation using lumberjack, simple and easy to use
log rotation module.

Signed-off-by: Shahar Klein <sklein@nvidia.com>
This commit is contained in:
Shahar Klein
2020-06-15 18:35:15 -07:00
committed by Tomofumi Hayashi
parent 3882e405ef
commit ecb79330c0
16 changed files with 1981 additions and 16 deletions

View File

@@ -30,24 +30,24 @@ var _ = Describe("logging operations", func() {
BeforeEach(func() {
loggingStderr = false
loggingFp = nil
loggingW = nil
loggingLevel = PanicLevel
})
It("Check file setter with empty", func() {
SetLogFile("")
Expect(loggingFp).To(BeNil())
Expect(loggingW).To(BeNil())
})
It("Check file setter with empty", func() {
SetLogFile("/tmp/foobar.logging")
Expect(loggingFp).NotTo(Equal(nil))
Expect(loggingW).NotTo(Equal(nil))
// check file existance
})
It("Check file setter with bad filepath", func() {
SetLogFile("/invalid/filepath")
Expect(loggingFp).NotTo(Equal(nil))
Expect(loggingW).NotTo(Equal(nil))
// check file existance
})