func Error(ctx context.Context, fields map[string]interface{}, format string, args ...interface{}) {
	if logger.Level >= log.ErrorLevel {
		entry := log.WithField("pid", os.Getpid())

		file, line, pName, fName, err := extractCallerDetails()
		if err == nil {
			entry = entry.WithField("file", file).WithField("pkg", pName).WithField("line", line).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).Errorf(format, args)
		} else {
			entry.WithFields(fields).Errorln(format)
		}
	}
}
// Error logs an error message that might contain the following attributes: pid,
// request id if provided by the context, file location of the caller, line that
// called the log Error function and the function name. Moreover, we can use the
// parameter fields to add additional attributes to the output message. Likewise
// format and args are used to print a detailed message with the reasons of the
// error log.
Error logs an error message that might contain the following attributes: pid,
request id if provided by the context, file location of the caller, line that
called the log Error function and the function name. Moreover, we can use the
parameter fields to add additional attributes to the output message. Likewise
format and args are used to print a detailed message with the reasons of the
error log.
// Error logs an error message that might contain the following attributes : pid // request id if provided by the context file location of the caller line that // called the log Error function and the function name . Moreover we can use the // parameter fields to add additional attributes to the output message . Likewise // format and args are used to print a detailed message with the reasons of the // error log .
func Error(ctx context.Context, fields map[string]interface{}, format string, args ...interface{}) {
	if logger.Level >= log.ErrorLevel {
		entry := log.WithField("pid", os.Getpid())
		file, line, pName, fName, err := extractCallerDetails()
		if err == nil {
			entry = entry.WithField("file", file).WithField("pkg", pName).WithField("line", line).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).Errorf(format, args)
		} else {
			entry.WithFields(fields).Errorln(format)
		}
	}
}
func Error ( ctx context . Context , fields map [ string ] interface { } , format string , args ... interface { } ) { if logger . Level >= log . ErrorLevel { entry := log . WithField ( " " , os . Getpid ( ) ) file , line , pName , fName , err := extractCallerDetails ( ) if err == nil { entry = entry . WithField ( " " , file ) . WithField ( " " , pName ) . WithField ( " " , line ) . 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 ) . Errorf ( format , args ) } else { entry . WithFields ( fields ) . Errorln ( format ) } } }
Error logs an error message that might contain the following attributes: pid,
request id if provided by the context, file location of the caller, line that
called the log Error function and the function name.
Error logs an error message that might contain the following attributes : pid request id if provided by the context file location of the caller line that called the log Error function and the function name .