func Warn(ctx context.Context, fields map[string]interface{}, format string, args ...interface{}) {
	if logger.Level >= log.WarnLevel {
		entry := log.NewEntry(logger)

		file, _, pName, fName, err := extractCallerDetails()
		if err == nil {
			entry = entry.WithField("file", file).WithField("pkg", pName).WithField("func", fName)
		}

		if ctx != nil {
			entry = entry.WithField("req_id", extractRequestID(ctx))
			identity_id, err := extractIdentityID(ctx)
			if err == nil { // Otherwise we don't use the identity_id
				entry = entry.WithField("identity_id", identity_id)
			}
		}

		if len(args) > 0 {
			entry.WithFields(fields).Warnf(format, args...)
		} else {
			entry.WithFields(fields).Warnln(format)
		}
	}
}
// Warn logs a warning message that might contain the following attributes:
// request id if provided by the context, the file and the
// function name that invoked the Warn() function. In this function, we can use
// the parameter fields to add additional attributes to the output of this
// message. Likewise format and args are used to print a detailed message with
// the reasons of the warning log.
Warn logs a warning message that might contain the following attributes:
request id if provided by the context, the file and the
function name that invoked the Warn() function. In this function, we can use
the parameter fields to add additional attributes to the output of this
message. Likewise format and args are used to print a detailed message with
the reasons of the warning log.
// Warn logs a warning message that might contain the following attributes : // request id if provided by the context the file and the // function name that invoked the Warn () function . In this function we can use // the parameter fields to add additional attributes to the output of this // message . Likewise format and args are used to print a detailed message with // the reasons of the warning log .
func Warn(ctx context.Context, fields map[string]interface{}, format string, args ...interface{}) {
	if logger.Level >= log.WarnLevel {
		entry := log.NewEntry(logger)
		file, _, pName, fName, err := extractCallerDetails()
		if err == nil {
			entry = entry.WithField("file", file).WithField("pkg", pName).WithField("func", fName)
		}
		if ctx != nil {
			entry = entry.WithField("req_id", extractRequestID(ctx))
			identity_id, err := extractIdentityID(ctx)
			if err == nil { 
				entry = entry.WithField("identity_id", identity_id)
			}
		}
		if len(args) > 0 {
			entry.WithFields(fields).Warnf(format, args...)
		} else {
			entry.WithFields(fields).Warnln(format)
		}
	}
}
func Warn ( ctx context . Context , fields map [ string ] interface { } , format string , args ... interface { } ) { if logger . Level >= log . WarnLevel { entry := log . NewEntry ( logger ) file , _ , pName , fName , err := extractCallerDetails ( ) if err == nil { entry = entry . WithField ( " " , file ) . WithField ( " " , pName ) . WithField ( " " , fName ) } if ctx != nil { entry = entry . WithField ( " " , extractRequestID ( ctx ) ) identity_id , err := extractIdentityID ( ctx ) if err == nil { entry = entry . WithField ( " " , identity_id ) } } if len ( args ) > 0 { entry . WithFields ( fields ) . Warnf ( format , args ... ) } else { entry . WithFields ( fields ) . Warnln ( format ) } } }
Warn logs a warning message that might contain the following attributes:
request id if provided by the context, the file and the
function name that invoked the Warn() function.
Warn logs a warning message that might contain the following attributes : request id if provided by the context the file and the function name that invoked the Warn () function .
// Otherwise we don't use the identity_id