forked from github/multus-cni
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:
committed by
Tomofumi Hayashi
parent
3882e405ef
commit
ecb79330c0
@@ -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
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user