Skip to content

Commit

Permalink
feat: 遵守 debug logging 的设置 (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 authored Apr 8, 2023
1 parent e88db05 commit 724f307
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/

## [Unreleased]

### Added

- 遵守 debug logging 的设置

### Changed

- 设置时区为中国
Expand Down
7 changes: 6 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,14 @@ def payload_to_event(
with ensure_cwd(Path(__file__).parent):
app_id = os.environ.get("APP_ID")
private_key = os.environ.get("PRIVATE_KEY")
# https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context
# 如果设置时,值总是为 "1"
runner_debug = os.environ.get("RUNNER_DEBUG", "0")

nonebot.init(
driver="~none", github_apps=[{"app_id": app_id, "private_key": private_key}]
driver="~none",
github_apps=[{"app_id": app_id, "private_key": private_key}],
log_level="DEBUG" if runner_debug == "1" else "INFO",
)

driver = nonebot.get_driver()
Expand Down

0 comments on commit 724f307

Please sign in to comment.