mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-26 13:12:12 +08:00
* feat: set docs openim-server url address fix Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * fix: add openim code fix Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --------- Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
1.4 KiB
1.4 KiB
Log Standards
Log Standards
- The unified log package
github.com/openimsdk/open-im-server/internal/pkg/logshould be used for all logging; - Use structured logging formats:
log.Infow,log.Warnw,log.Errorw, etc. For example:log.Infow("Update post function called"); - All logs should start with an uppercase letter and should not end with a
.. For example:log.Infow("Update post function called"); - Use past tense. For example, use
Could not delete Binstead ofCannot delete B; - Adhere to log level standards:
- Debug level logs use
log.Debugw; - Info level logs use
log.Infow; - Warning level logs use
log.Warnw; - Error level logs use
log.Errorw; - Panic level logs use
log.Panicw; - Fatal level logs use
log.Fatalw.
- Debug level logs use
- Log settings:
- Development and test environments: The log level is set to
debug, the log format can be set toconsole/jsonas needed, and caller is enabled; - Production environment: The log level is set to
info, the log format is set tojson, and caller is enabled. (Note: In the early stages of going online, to facilitate troubleshooting, the log level can be set todebug)
- Development and test environments: The log level is set to
- When logging, avoid outputting sensitive information, such as passwords, keys, etc.
- If you are calling a logging function in a function/method with a
context.Contextparameter, it is recommended to uselog.L(ctx).Infow()for logging.