开发者社区> 问答> 正文

如何在Java中使用AppErrorMessages类来打印带有参数的错误消息?

如何在Java中使用AppErrorMessages类来打印带有参数的错误消息?

展开
收起
萝卜丝丸子 2024-08-05 21:24:14 22 0
1 条回答
写回答
取消 提交回答
  • 你可以直接调用AppErrorMessages.message方法,并传入错误码和需要替换到消息中的参数。例如:

    log.info(AppErrorMessages.message("APP-100-400", "xxx@example.com"));
    这将输出类似"APP-100-400 - Failed to log in system with email and password(Email login failed): can not find account with email xxx@example.com --- please refer https://example.com/login/byemail --- Solutions: 1. check your email 2. check your password"的日志信息。
    
    2024-08-05 21:59:47
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载