From 2890eb8c92804fb41a0fee33e9dfb3524f2a941e Mon Sep 17 00:00:00 2001 From: tommy <3405129587@qq.com> Date: Tue, 2 Jun 2020 15:32:13 +0800 Subject: [PATCH] fix --- controllers/client/auction.go | 9 +++---- controllers/client/login.go | 5 ---- controllers/client/reward.go | 5 ++-- controllers/client/sign.go | 1 + controllers/common/wechat_oauth.go | 29 ++++++++++++++--------- controllers/pc/sign.go | 8 ++----- go.mod | 1 + log/hdzj.log | 48 ++++++++++++++++++++++++++++++++++++++ logger/logger.go | 42 +++++++++++++++++++++++++-------- models/reward_history.go | 3 ++- models/sign_history.go | 4 ++-- services/pay/handle.go | 2 +- services/pay/order.go | 16 +++++-------- test/config_test.go | 2 +- test/order_test.go | 14 +++++++++-- 15 files changed, 134 insertions(+), 55 deletions(-) diff --git a/controllers/client/auction.go b/controllers/client/auction.go index e228257..516081b 100644 --- a/controllers/client/auction.go +++ b/controllers/client/auction.go @@ -19,6 +19,7 @@ func (t *AuctionCtl) Auction() { auctionId := t.MustGetInt64("auction_activity_id") totalMoney := t.MustGetDouble("total_money") uid := t.MustGetUID() + areaId := t.MustGetInt64("area_id") if totalMoney < 0 { t.ERROR("金额不能为0", code.MSG_ERR) @@ -42,7 +43,7 @@ func (t *AuctionCtl) Auction() { t.Assert(exist, code.MSG_USER_NOT_EXIST, "用户不存在") area := new(models.AreaStore) - exist, err = models.Get(area, user.AreaId) + exist, err = models.Get(area, areaId) t.CheckErr(err) t.Assert(exist, code.MSG_AREASTORE_NOT_EXIST, "地区不存在") @@ -57,7 +58,7 @@ func (t *AuctionCtl) Auction() { history.ActivityId = activity.Id history.RehearsalId = activity.RehearsalId history.UserId = uid - history.AreaId = user.AreaId + history.AreaId = area.Id history.UserName = user.Nickname history.AreaName = area.Name history.UserPhone = user.Phone @@ -112,8 +113,8 @@ func (t *AuctionCtl) Auction() { record.UserId = uid record.UserPhone = user.Phone record.UserName = user.Nickname - record.AreaId = user.AreaId - record.AreaName = user.AreaName + record.AreaId = area.Id + record.AreaName = area.Name record.DealPrice = totalMoney record.RehearsalId = activity.RehearsalId record.PlayerCode = player.Code diff --git a/controllers/client/login.go b/controllers/client/login.go index 17ea124..e1d4a4b 100644 --- a/controllers/client/login.go +++ b/controllers/client/login.go @@ -132,9 +132,6 @@ func (t *UserCtl) WxLogin() { signIn = "已签到" } - //realSignExist, err := new(models.RealSignHistory).Check(user.Id, activity.Id, activity.RehearsalId) - //t.CheckErr(err) - jwtToken, err := jwt.GenJwtToken(define.TYPE_H5USER, user.Id, customer.Id, customer.Pid, area.Id, activityId) t.CheckErr(err) t.SetSession(define.TOKEN, jwtToken) @@ -154,8 +151,6 @@ func (t *UserCtl) WxLogin() { func (t *UserCtl) Login() { wxcode := t.MustGet("code") // _type, _ := t.Get("type") - - logger.Error("错误code:", wxcode) user := new(models.User) token, err := wechat.GetToken(wxcode) t.CheckErr(err) diff --git a/controllers/client/reward.go b/controllers/client/reward.go index b306449..0b65311 100644 --- a/controllers/client/reward.go +++ b/controllers/client/reward.go @@ -54,10 +54,11 @@ func (t *RewardCtl) Reward() { t.Assert(exist, code.MSG_USER_NOT_EXIST, "用户不存在") var res = make(map[string]interface{}, 0) + var expireAt = time.Now().Add(24 * time.Hour).Unix() res["out_trade_no"] = "" if activity.RehearsalId == 0 || _type == 1 { // 直播不用彩排 res, err = pay_service.UnifiedOrder("欧轩互动-打赏支付", user.Openid, int64(amount*100), 2, - user.Id, activityId, time.Now().Add(1*time.Hour).Unix()) + user.Id, activityId, expireAt) t.CheckErr(err) } @@ -72,7 +73,7 @@ func (t *RewardCtl) Reward() { RehearsalId: activity.RehearsalId, Status: -1, ReviewTime: 0, - ExpireTime: time.Now().Add(24 * time.Hour).Unix(), + ExpireTime: expireAt, Type: _type, } diff --git a/controllers/client/sign.go b/controllers/client/sign.go index fbe7a9e..2a6c3b3 100644 --- a/controllers/client/sign.go +++ b/controllers/client/sign.go @@ -144,6 +144,7 @@ func (t *SignCtl) Sign() { signHistory.ActivityId = activityId signHistory.SignRuleId = signUp.Id signHistory.AreaId = areaId + signHistory.Status = 2 signHistory.IsDelete = false signHistory.UpdatedAt = time.Now() signHistory.CreatedAt = time.Now() diff --git a/controllers/common/wechat_oauth.go b/controllers/common/wechat_oauth.go index 2a35c8c..d7e13d4 100644 --- a/controllers/common/wechat_oauth.go +++ b/controllers/common/wechat_oauth.go @@ -69,30 +69,36 @@ type CallbackParam struct { ReturnMsg CDATA `xml:"return_msg"` } -var counter = new(atomic.Int64) +var orderSuccessCounter = new(atomic.Int64) +var orderFailedCounter = new(atomic.Int64) +var refundSuccessCounter = new(atomic.Int64) +var refundFailedCounter = new(atomic.Int64) func (t *WeChatOauthCtl) CallbackOrder() { - counter.Add(1) //搜索支付的order表, 查找到某条记录 _, err := pay_service.NotifyOrder(t.Request.BODY) param := new(CallbackParam) if err != nil { + logger.Error(err) + orderFailedCounter.Add(1) + logger.Error(fmt.Sprintf("call order失败微信响应次数: %v", orderFailedCounter.Load())) param.ReturnCode = CDATA{Text: define.CODE_FAIL} param.ReturnMsg = CDATA{Text: err.Error()} } else { + orderSuccessCounter.Add(1) + logger.Error(fmt.Sprintf("call order成功微信响应次数: %v", orderSuccessCounter.Load())) param.ReturnCode = CDATA{Text: define.CODE_SUCCESS} param.ReturnMsg = CDATA{Text: "OK"} } xmlRes, _ := xml.Marshal(param) if t.Request.OriginRequest.Method == "GET" { t.JSON(map[string]interface{}{ - "counter": counter.Load(), - "time": time.Now(), - "xml": param, + "time": time.Now(), + "xml": param, }) + return } - logger.Error(fmt.Sprintf("微信响应次数: %v", counter.Load())) t.XML(xmlRes) } @@ -100,21 +106,22 @@ func (t *WeChatOauthCtl) CallbackRefund() { _, err := pay_service.NotifyRefund(t.Request.BODY) param := new(CallbackParam) if err != nil { - logger.Error("", err) + refundFailedCounter.Add(1) + logger.Error(fmt.Sprintf("call refund失败微信响应次数: %v", refundFailedCounter.Load())) param.ReturnCode = CDATA{Text: define.CODE_FAIL} param.ReturnMsg = CDATA{Text: err.Error()} } else { + refundSuccessCounter.Add(1) + logger.Error(fmt.Sprintf("call refund成功微信响应次数: %v", refundSuccessCounter.Load())) param.ReturnCode = CDATA{Text: define.CODE_SUCCESS} param.ReturnMsg = CDATA{Text: "OK"} } xmlRes, _ := xml.Marshal(param) if t.Request.OriginRequest.Method == "GET" { t.JSON(map[string]interface{}{ - "counter": counter.Load(), - "time": time.Now(), - "xml": param, + "time": time.Now(), + "xml": param, }) } - logger.Error(fmt.Sprintf("微信响应次数: %v", counter.Load())) t.XML(xmlRes) } diff --git a/controllers/pc/sign.go b/controllers/pc/sign.go index e392086..4bb3c1c 100644 --- a/controllers/pc/sign.go +++ b/controllers/pc/sign.go @@ -99,7 +99,7 @@ func (t *SignCtl) SignInfo() { func (t *SignCtl) RealSignInfo() { aid := t.MustGetInt64("activity_id") rid := t.MustGetInt64("rehearsal_id") - results, err := models.GetSignHistories(aid, rid) + results, err := models.GetApplyRealSigns(aid, rid) t.CheckErr(err) t.JSON(map[string]interface{}{ "result": results, @@ -109,13 +109,9 @@ func (t *SignCtl) RealSignInfo() { func (t *SignCtl) RealSignVerify() { ids := strings.Split(t.MustGet("real_sign_history_ids"), ",") - idList := make([]interface{}, len(ids)) - for _, id := range ids { - idList = append(idList, id) - } history := new(models.SignHistory) history.Status = 2 - err := history.UpdateById(idList, "status") + err := history.UpdateById(ids, "status") t.CheckErr(err) t.SUCCESS("审核成功") } diff --git a/go.mod b/go.mod index 6d6c153..a906436 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( github.com/go-chi/chi v4.1.0+incompatible github.com/go-errors/errors v1.0.2 // indirect github.com/go-redis/redis v6.15.7+incompatible // indirect + github.com/go-stack/stack v1.8.0 github.com/golang/snappy v0.0.1 // indirect github.com/gorilla/websocket v1.4.2 github.com/iGoogle-ink/gopay/v2 v2.0.5 diff --git a/log/hdzj.log b/log/hdzj.log index 9fbbf6b..4dcca27 100644 --- a/log/hdzj.log +++ b/log/hdzj.log @@ -392,3 +392,51 @@ 2020-06-02 09:29:38.051 ERROR logger/logger.go:87 定时任务错误原因dial tcp: lookup ouxuanhudongapi.t.3pr.com.cn: no such host 2020-06-02 10:25:13.946 ERROR logger/logger.go:87 获取过期打赏错误原因Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 2020-06-02 10:25:13.946 ERROR logger/logger.go:87 定时任务错误原因Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 +2020-06-02 11:17:39.778 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.778 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.832 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.835 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.835 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.836 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.836 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.837 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.837 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.838 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.838 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.839 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.841 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.841 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.846 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.846 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.846 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.846 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.846 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.846 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.937 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.946 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.985 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:39.989 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.193 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.193 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.235 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.236 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.238 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.238 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.242 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.242 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.242 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.242 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.243 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.243 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.243 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.243 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.243 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.243 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.246 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.246 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.246 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.246 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.362 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.365 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.410 ERROR logger/logger.go:87 客户订单异常 +2020-06-02 11:17:47.413 ERROR logger/logger.go:87 客户订单异常 diff --git a/logger/logger.go b/logger/logger.go index fd998cc..b8d4337 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -1,10 +1,12 @@ package logger import ( + "github.com/go-stack/stack" "go.uber.org/zap" "go.uber.org/zap/zapcore" "gopkg.in/natefinch/lumberjack.v2" "os" + "path/filepath" "time" ) @@ -12,21 +14,37 @@ import ( var logger *zap.SugaredLogger func init() { - InitZap() + SetLevel("debug") } -func InitZap() { + +// @func SetLevel 设置日志等级 +// @param level 日志等级从高大底: fatal panic dpanic error warn info debug +func SetLevel(level string) { + wd, _ := os.Getwd() + SetLogger(filepath.Join(wd, "log", "hdzj.log"), level, 1024, 10, 7) +} + +// @func SetLogger 日志定制化, 包括日志切割的定制化 +// @param filename 存放日志的文件, 最好带上路径 +// @param level 日志写入的等级 +// @param size 单个日志文件的大小 +// @param backups 日志备份的数量 +// @param age 日志存放的时间 +func SetLogger(filename, level string, size, backups, age int) { w := zapcore.AddSync(&lumberjack.Logger{ - Filename: "log/hdzj.log", - MaxSize: 50, // megabytes - MaxBackups: 3, - MaxAge: 7, // days + Filename: filename, + MaxSize: size, // megabytes + MaxBackups: backups, + MaxAge: age, // days }) + core := zapcore.NewCore( zapcore.NewConsoleEncoder(NewEncoderConfig()), zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stdout), w), - zap.DebugLevel) + Level(level)) logger = zap.New(core, zap.AddCaller()).Sugar() } + func NewEncoderConfig() zapcore.EncoderConfig { return zapcore.EncoderConfig{ // Keys can be anything except the empty string. @@ -40,15 +58,19 @@ func NewEncoderConfig() zapcore.EncoderConfig { EncodeLevel: zapcore.CapitalLevelEncoder, EncodeTime: TimeEncoder, EncodeDuration: zapcore.StringDurationEncoder, - EncodeCaller: zapcore.ShortCallerEncoder, + EncodeCaller: func(caller zapcore.EntryCaller, encoder zapcore.PrimitiveArrayEncoder) { + frame := stack.Caller(7).Frame() + caller.Line = frame.Line + caller.File = frame.File + encoder.AppendString(caller.TrimmedPath()) + }, } } - func TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder) { enc.AppendString(t.Format("2006-01-02 15:04:05.000")) } -func level(level string) zapcore.Level { +func Level(level string) zapcore.Level { switch level { case "info": return zap.InfoLevel diff --git a/models/reward_history.go b/models/reward_history.go index be58638..2ebb567 100644 --- a/models/reward_history.go +++ b/models/reward_history.go @@ -64,7 +64,8 @@ func GetRewardHistoryByIds(ids interface{}) ([]*RewardHistory, error) { func GetExpireRewardHistory() ([]*RewardHistory, error) { result := make([]*RewardHistory, 0) - err := core.GetXormAuto().Where("is_delete=0 and status=0 and expire_time<=?", time.Now().Unix()).Find(&result) + err := core.GetXormAuto().Where("rehearsal_id = 0 or type <> 0"). + Where("is_delete=0 and status=0 and expire_time<=?", time.Now().Unix()).Find(&result) return result, err } diff --git a/models/sign_history.go b/models/sign_history.go index 5b34e55..ff4b1ff 100644 --- a/models/sign_history.go +++ b/models/sign_history.go @@ -30,7 +30,7 @@ func (t *SignHistory) TableName() string { } func (t *SignHistory) GetByUserId(aid, uid, rid, arid int64) (bool, error) { - return core.GetXormAuto().Where("is_delete=0 and activity_id=? and user_id=? and "+ + return core.GetXormAuto().Where("is_delete=0 and status=2 and activity_id=? and user_id=? and "+ "rehearsal_id=? and area_id=?", aid, uid, rid, arid).Get(t) } @@ -53,7 +53,7 @@ func (t *SignHistory) Insert() error { return err } -func GetSignHistories(aid interface{}, rid interface{}) ([]*SignHistory, error) { +func GetApplyRealSigns(aid interface{}, rid interface{}) ([]*SignHistory, error) { results := make([]*SignHistory, 0) err := core.GetXormAuto().Where("is_delete=0 and activity_id=? and rehearsal_id=? and status=1", aid, rid).Asc("updated_at").Find(&results) diff --git a/services/pay/handle.go b/services/pay/handle.go index 6bfefc3..2bc3e38 100644 --- a/services/pay/handle.go +++ b/services/pay/handle.go @@ -14,7 +14,7 @@ import ( ) func init() { - go loopOrder() + //go loopOrder() go utils.HandleTicker(1*time.Hour, HandleReward) // 打赏24小时退款 } diff --git a/services/pay/order.go b/services/pay/order.go index 3b8c83e..d8be0cd 100644 --- a/services/pay/order.go +++ b/services/pay/order.go @@ -32,7 +32,7 @@ func UnifiedOrder(content, openId string, fee, goodType, userId, activityId, exp body["nonce_str"] = nonceStr body["sign_type"] = pay_core.SignType_MD5 body["openid"] = openId - // body["time_expire"] = pay_core.FormatTime(time.Unix(expireAt, 0)) + //body["time_expire"] = pay_core.FormatTime(time.Unix(expireAt, 0)) resp, err := pay.UnifiedOrder(client, body) if err != nil { @@ -106,6 +106,8 @@ func ReOrder(outTradeNo string) (map[string]interface{}, error) { // Notify type NotifyOrderParam struct { + XMLName struct{} `xml:"xml" json:"-"` + ReturnCode string `xml:"return_code,omitempty" json:"return_code,omitempty"` ReturnMsg string `xml:"return_msg,omitempty" json:"return_msg,omitempty"` ResultCode string `xml:"result_code,omitempty" json:"result_code,omitempty"` @@ -136,26 +138,23 @@ func NotifyOrder(body string) (*models.UserOrder, error) { err := xml.Unmarshal([]byte(body), &res) if err != nil { err = fmt.Errorf("xml unmarsal error:%+v", err) - logger.Error(err) return nil, err } if res.ReturnCode != define.CODE_SUCCESS { err = fmt.Errorf("network error, retrun_code: %+v and return_msg: %+v", res.ReturnCode, res.ReturnMsg) - logger.Error(err) return nil, err } if res.ResultCode != define.CODE_SUCCESS { err = fmt.Errorf("trade error, result_code: %+v and err_code: %+v and err_desc: %+v", res.ResultCode, res.ErrCode, res.ErrCodeDes) - logger.Error(err) return nil, err } order := new(models.UserOrder) exist, err := order.GetByOutTradeNo(res.OutTradeNo) - if err == nil || !exist { + if err != nil || !exist { err = fmt.Errorf("user order get by out_trade_no: %+v, error: %+v, exist: %+v", res.OutTradeNo, err, exist) return nil, err } @@ -176,11 +175,6 @@ func NotifyOrder(body string) (*models.UserOrder, error) { } -type OrderQueryResult struct { - Order *models.UserOrder - Query *pay.OrderQueryResponse -} - func OrderQuery(outTradeNo string) (map[string]string, error) { client, err := Client() if err != nil { @@ -278,6 +272,8 @@ func QueryRefund(outTradeNo string) (*pay.RefundQueryResponse, error) { } type NotifyRefundParam struct { + XMLName struct{} `xml:"xml" json:"-"` + ReturnCode string `xml:"return_code,omitempty" json:"return_code,omitempty"` ReturnMsg string `xml:"return_msg,omitempty" json:"return_msg,omitempty"` ResultCode string `xml:"result_code,omitempty" json:"result_code,omitempty"` diff --git a/test/config_test.go b/test/config_test.go index 72b3229..35fdefc 100644 --- a/test/config_test.go +++ b/test/config_test.go @@ -196,7 +196,7 @@ func TestDuration(t *testing.T) { //} func TestRefundRedPack(t *testing.T) { - res, err := pay_service.Refund("退款", "f8nYoKC5Gk0O5t68AzU3boo2eJfETKRf") + res, err := pay_service.Refund("退款", "9dAV4ROBNLZgAHzrRmF55uCKsGvNGkeE") fmt.Printf("%+v, %v", res, err) //res, err := pay_service.QueryRedPack("tDYW8edlzegSlVNaJMXsteZEeuVL") //fmt.Printf("%+v, %+v", res, err) diff --git a/test/order_test.go b/test/order_test.go index 882317a..27997c6 100644 --- a/test/order_test.go +++ b/test/order_test.go @@ -2,6 +2,7 @@ package test import ( "fmt" + "hudongzhuanjia/logger" pay_service "hudongzhuanjia/services/pay" "testing" "time" @@ -17,7 +18,8 @@ func TestUnifiedOrder(t *testing.T) { } func TestRefund(t *testing.T) { - res, err := pay_service.Refund("测试退款", "ZxzwZv6B0A0JmiDsKMUvFCDTupu4v3kZ") + //res, err := pay_service.Refund("测试退款", "ZxzwZv6B0A0JmiDsKMUvFCDTupu4v3kZ") + res, err := pay_service.Refund("测试退款", "9dAV4ROBNLZgAHzrRmF55uCKsGvNGkeE") if err != nil { t.Error(err) } @@ -25,7 +27,15 @@ func TestRefund(t *testing.T) { } func TestApi(t *testing.T) { - res, err := pay_service.SendRedPack("欧轩测试", "o9XM41l_c27wRuc33hutRVwsQO4U", + res, err := pay_service.SendRedPack("欧轩测试", "9dAV4ROBNLZgAHzrRmF55uCKsGvNGkeE", "恭喜发财", "抢红包活动", "越抢越多", 1, 1, 1) fmt.Println(res, err) } + +func TestHandleReward(t *testing.T) { + pay_service.HandleReward() +} + +func TestLoggerLine(t *testing.T) { + logger.Error("test") +}