1// Copyright 2019 The Xorm Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5package core 6 7// LogLevel defines a log level 8type LogLevel int 9 10// enumerate all LogLevels 11const ( 12 // !nashtsai! following level also match syslog.Priority value 13 LOG_DEBUG LogLevel = iota 14 LOG_INFO 15 LOG_WARNING 16 LOG_ERR 17 LOG_OFF 18 LOG_UNKNOWN 19) 20 21// ILogger is a logger interface 22type ILogger interface { 23 Debug(v ...interface{}) 24 Debugf(format string, v ...interface{}) 25 Error(v ...interface{}) 26 Errorf(format string, v ...interface{}) 27 Info(v ...interface{}) 28 Infof(format string, v ...interface{}) 29 Warn(v ...interface{}) 30 Warnf(format string, v ...interface{}) 31 32 Level() LogLevel 33 SetLevel(l LogLevel) 34 35 ShowSQL(show ...bool) 36 IsShowSQL() bool 37} 38