<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Logging on tenfy's blog</title><link>https://tenfy.cn/tags/logging/</link><description>Recent content in Logging on tenfy's blog</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Fri, 31 May 2024 00:01:36 +0800</lastBuildDate><atom:link href="https://tenfy.cn/tags/logging/index.xml" rel="self" type="application/rss+xml"/><item><title>Golang rpc服务更优雅的error处理和打印日志</title><link>https://tenfy.cn/posts/go-error-handling/</link><pubDate>Fri, 31 May 2024 00:01:36 +0800</pubDate><guid>https://tenfy.cn/posts/go-error-handling/</guid><description>&lt;p>服务器代码中，错误处理占据了大部分的逻辑。特别是C族语言，喜欢使用错误码，而不是异常来处理错误。
错误码比异常的优势是，性能会更好一些。抛出异常的话，因为有异常栈的展开，性能开销会大很多。
在Golang中，有一个error的接口来处理错误。&lt;/p></description></item></channel></rss>