@@ -94,7 +94,7 @@ type defaultLogOptions struct {
9494
9595func newDefaultLogOptions () defaultLogOptions {
9696 return defaultLogOptions {
97- levelName : LogLevel ,
97+ levelName : LogLevel . String () ,
9898 flags : "stdflags" ,
9999 filename : filepath .Join (LogRootPath , "gitea.log" ),
100100 bufferLength : 10000 ,
@@ -115,9 +115,9 @@ type LogDescription struct {
115115 SubLogDescriptions []SubLogDescription
116116}
117117
118- func getLogLevel (section * ini.Section , key string , defaultValue string ) string {
119- value := section .Key (key ).MustString ("info" )
120- return log .FromString (value ). String ()
118+ func getLogLevel (section * ini.Section , key string , defaultValue log. Level ) log. Level {
119+ value := section .Key (key ).MustString (defaultValue . String () )
120+ return log .FromString (value )
121121}
122122
123123func getStacktraceLogLevel (section * ini.Section , key string , defaultValue string ) string {
@@ -126,8 +126,7 @@ func getStacktraceLogLevel(section *ini.Section, key string, defaultValue string
126126}
127127
128128func generateLogConfig (sec * ini.Section , name string , defaults defaultLogOptions ) (mode , jsonConfig , levelName string ) {
129- levelName = getLogLevel (sec , "LEVEL" , LogLevel )
130- level := log .FromString (levelName )
129+ level := getLogLevel (sec , "LEVEL" , LogLevel )
131130 stacktraceLevelName := getStacktraceLogLevel (sec , "STACKTRACE_LEVEL" , StacktraceLogLevel )
132131 stacktraceLevel := log .FromString (stacktraceLevelName )
133132 mode = name
0 commit comments