---
title: 使用日志进行调试
product: Cloud Code
version: 3.1.0
latest_version: 3.1.0
status: This page documents version 3.1.0. The latest version is 3.1.0.
canonical: https://docs.unity.com/zh-cn/cloud-code/3.1.0/server-authority-debug
latest_url: https://docs.unity.com/zh-cn/cloud-code/3.1.0/server-authority-debug.md
last_updated: 2026-11-20
generated_at: 2026-12-03T02:29:31.957Z
locale: zh-cn
---

# 使用日志进行调试

> Add custom log statements to debug issues and increase observability in your game.

在支持服务器权威的游戏中，您的代码不在玩家客户端上。这意味着拥有适当的观察能力来调试服务器权威游戏中的问题非常重要。要监控您的游戏，您可以使用 Cloud Code 和 Triggers 自动生成的日志。

为了避免复杂云端代码中的盲点，您需要详细的日志。您可以在 Cloud Code 中添加自己的[自定义日志语句](./logging/tutorials/emit-logs.md)来记录调试信息。例如，可以按照某种策略来记录步骤、输入、输出和错误，以提高观察能力并帮助您查明错误。

如需了解更多信息，请参阅[日志记录](./logging/overview.md)。
