File tree 2 files changed +14
-9
lines changed
2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 1
1
package bootstrap
2
2
3
3
import (
4
+ "log"
5
+ "time"
6
+
4
7
"github.com/alist-org/alist/v3/cmd/args"
5
8
"github.com/alist-org/alist/v3/conf"
6
9
rotatelogs "github.com/lestrrat-go/file-rotatelogs"
7
10
"github.com/sirupsen/logrus"
8
- "log"
9
- "time"
10
11
)
11
12
12
- func Log () {
13
- log .SetOutput (logrus .StandardLogger ().Out )
14
- if args .Debug {
15
- logrus .SetLevel (logrus .DebugLevel )
16
- logrus .SetReportCaller (true )
17
- }
13
+ func init () {
18
14
logrus .SetFormatter (& logrus.TextFormatter {
19
15
ForceColors : true ,
20
16
EnvironmentOverrideColors : true ,
21
17
TimestampFormat : "2006-01-02 15:04:05" ,
22
18
FullTimestamp : true ,
23
19
})
20
+ }
21
+
22
+ func Log () {
23
+ log .SetOutput (logrus .StandardLogger ().Out )
24
+ if args .Debug {
25
+ logrus .SetLevel (logrus .DebugLevel )
26
+ logrus .SetReportCaller (true )
27
+ }
24
28
logConfig := conf .Conf .Log
25
29
if logConfig .Enable {
26
30
var (
Original file line number Diff line number Diff line change @@ -3,13 +3,14 @@ package main
3
3
import (
4
4
"flag"
5
5
"fmt"
6
+ "os"
7
+
6
8
"github.com/alist-org/alist/v3/bootstrap"
7
9
"github.com/alist-org/alist/v3/cmd/args"
8
10
"github.com/alist-org/alist/v3/conf"
9
11
_ "github.com/alist-org/alist/v3/drivers"
10
12
"github.com/gin-gonic/gin"
11
13
log "github.com/sirupsen/logrus"
12
- "os"
13
14
)
14
15
15
16
func init () {
You can’t perform that action at this time.
0 commit comments