用户登录和接口鉴权
This commit is contained in:
@@ -23,20 +23,20 @@ func NewLogger() *Logger {
|
||||
|
||||
// Info 记录信息级别日志
|
||||
func (l *Logger) Info(message string) {
|
||||
l.logger.Printf("[INFO] %s %s", time.Now().Format(time.RFC3339), message)
|
||||
l.logger.Printf("[信息] %s %s", time.Now().Format(time.RFC3339), message)
|
||||
}
|
||||
|
||||
// Error 记录错误级别日志
|
||||
func (l *Logger) Error(message string) {
|
||||
l.logger.Printf("[ERROR] %s %s", time.Now().Format(time.RFC3339), message)
|
||||
l.logger.Printf("[错误] %s %s", time.Now().Format(time.RFC3339), message)
|
||||
}
|
||||
|
||||
// Debug 记录调试级别日志
|
||||
func (l *Logger) Debug(message string) {
|
||||
l.logger.Printf("[DEBUG] %s %s", time.Now().Format(time.RFC3339), message)
|
||||
l.logger.Printf("[调试] %s %s", time.Now().Format(time.RFC3339), message)
|
||||
}
|
||||
|
||||
// Warn 记录警告级别日志
|
||||
func (l *Logger) Warn(message string) {
|
||||
l.logger.Printf("[WARN] %s %s", time.Now().Format(time.RFC3339), message)
|
||||
l.logger.Printf("[警告] %s %s", time.Now().Format(time.RFC3339), message)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user