> For the complete documentation index, see [llms.txt](https://blog.cweihang.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blog.cweihang.io/thinking-in-program/log.md).

# 怎样打日志

LOG最重要的作用即是为程序出bug时调试提供思路，

一个自定义的log，需要有几个要素：

* 时间，以知道哪些log是我们所需要的，
* 标签，判断哪些log是属于哪些模块的，不然log太凌乱了

可以参考我的android代码库中的[Log](https://github.com/ahangchen/Trd/tree/master/app/src/main/java/ahang/util/log)
