summaryrefslogtreecommitdiffstats
path: root/vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go
diff options
context:
space:
mode:
authormsglm <msglm@techchud.xyz>2023-10-27 07:08:25 -0500
committermsglm <msglm@techchud.xyz>2023-10-27 07:08:25 -0500
commit032a7e0c1188d3507b8d9a9571f2446a43cf775b (patch)
tree2bd38c01bc7761a6195e426082ce7191ebc765a1 /vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go
parent56e7bd01ca09ad52b0c4f48f146a20a4f1b78696 (diff)
downloadmatterbridge-msglm-032a7e0c1188d3507b8d9a9571f2446a43cf775b.tar.gz
matterbridge-msglm-032a7e0c1188d3507b8d9a9571f2446a43cf775b.tar.bz2
matterbridge-msglm-032a7e0c1188d3507b8d9a9571f2446a43cf775b.zip
apply https://github.com/42wim/matterbridge/pull/1864v1.26.0+0.1.0
Diffstat (limited to 'vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go')
-rw-r--r--vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go b/vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go
index 46d97c55..3447cdc0 100644
--- a/vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go
+++ b/vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go
@@ -120,7 +120,7 @@ var (
currentTime = time.Now
// os_Stat exists so it can be mocked out by tests.
- os_Stat = os.Stat
+ osStat = os.Stat
// megabyte is the conversion factor between MaxSize and bytes. It is a
// variable so tests can mock it out and not need to write megabytes of data
@@ -206,14 +206,14 @@ func (l *Logger) rotate() error {
// openNew opens a new log file for writing, moving any old log file out of the
// way. This methods assumes the file has already been closed.
func (l *Logger) openNew() error {
- err := os.MkdirAll(l.dir(), 0744)
+ err := os.MkdirAll(l.dir(), 0755)
if err != nil {
return fmt.Errorf("can't make directories for new logfile: %s", err)
}
name := l.filename()
- mode := os.FileMode(0644)
- info, err := os_Stat(name)
+ mode := os.FileMode(0600)
+ info, err := osStat(name)
if err == nil {
// Copy the mode off the old logfile.
mode = info.Mode()
@@ -265,7 +265,7 @@ func (l *Logger) openExistingOrNew(writeLen int) error {
l.mill()
filename := l.filename()
- info, err := os_Stat(filename)
+ info, err := osStat(filename)
if os.IsNotExist(err) {
return l.openNew()
}
@@ -288,7 +288,7 @@ func (l *Logger) openExistingOrNew(writeLen int) error {
return nil
}
-// genFilename generates the name of the logfile from the current time.
+// filename generates the name of the logfile from the current time.
func (l *Logger) filename() string {
if l.Filename != "" {
return l.Filename
@@ -376,7 +376,7 @@ func (l *Logger) millRunOnce() error {
// millRun runs in a goroutine to manage post-rotation compression and removal
// of old log files.
func (l *Logger) millRun() {
- for _ = range l.millCh {
+ for range l.millCh {
// what am I going to do, log this?
_ = l.millRunOnce()
}
@@ -472,7 +472,7 @@ func compressLogFile(src, dst string) (err error) {
}
defer f.Close()
- fi, err := os_Stat(src)
+ fi, err := osStat(src)
if err != nil {
return fmt.Errorf("failed to stat log file: %v", err)
}