Update logger.go
This commit is contained in:
		
							parent
							
								
									6a4528640e
								
							
						
					
					
						commit
						64ad9115e2
					
				| @ -135,21 +135,21 @@ func (l *logger) LogMode(level LogLevel) Interface { | ||||
| 
 | ||||
| // Info print info
 | ||||
| func (l *logger) Info(ctx context.Context, msg string, data ...interface{}) { | ||||
| 	if l.LogLevel >= Info { | ||||
| 	if l.LogLevel <= Info { | ||||
| 		l.Printf(l.infoStr+msg, append([]interface{}{utils.FileWithLineNum()}, data...)...) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // Warn print warn messages
 | ||||
| func (l *logger) Warn(ctx context.Context, msg string, data ...interface{}) { | ||||
| 	if l.LogLevel >= Warn { | ||||
| 	if l.LogLevel <= Warn { | ||||
| 		l.Printf(l.warnStr+msg, append([]interface{}{utils.FileWithLineNum()}, data...)...) | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // Error print error messages
 | ||||
| func (l *logger) Error(ctx context.Context, msg string, data ...interface{}) { | ||||
| 	if l.LogLevel >= Error { | ||||
| 	if l.LogLevel <= Error { | ||||
| 		l.Printf(l.errStr+msg, append([]interface{}{utils.FileWithLineNum()}, data...)...) | ||||
| 	} | ||||
| } | ||||
| @ -158,7 +158,7 @@ func (l *logger) Error(ctx context.Context, msg string, data ...interface{}) { | ||||
| //
 | ||||
| //nolint:cyclop
 | ||||
| func (l *logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error) { | ||||
| 	if l.LogLevel <= Silent { | ||||
| 	if l.LogLevel >= Silent { | ||||
| 		return | ||||
| 	} | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Radmehr Soleimanian
						Radmehr Soleimanian