# 怎样打日志

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

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

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

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.cweihang.io/thinking-in-program/log.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
