Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: 调整日志输出格式与等级 #1233

Merged
merged 7 commits into from
Sep 9, 2022
Merged

Conversation

yanyongyu
Copy link
Member

@yanyongyu yanyongyu commented Sep 7, 2022

related issue: #1134 @A-kirami

Example:

09-07 08:35:54 [SUCCESS] nonebot | NoneBot is initializing...
09-07 08:35:54 [INFO] nonebot | Current Env: prod
09-07 08:35:54 [DEBUG] nonebot | Loaded Config: {'driver': '~fastapi', 'host': IPv4Address('127.0.0.1'), 'port': 8080, 'log_level': 'TRACE', 'api_timeout': 30.0, 'superusers': set(), 'nickname': set(), 'command_start': {'/'}, 'command_sep': {'.'}, 'session_expire_timeout': datetime.timedelta(seconds=120), 'environment': 'prod'}
09-07 08:35:54 [DEBUG] nonebot | Succeeded to load adapter "Onebot V11"
09-07 08:35:54 [DEBUG] nonebot | Adapter "Onebot V11" already exists
09-07 08:35:54 [SUCCESS] nonebot | Succeeded to import "xxx_plugin"
09-07 08:35:54 [SUCCESS] nonebot | Succeeded to import "nonebot.plugins.echo"
09-07 08:35:54 [SUCCESS] nonebot | Running NoneBot...
09-07 08:35:54 [DEBUG] nonebot | Loaded adapters: Onebot V11
09-07 08:35:55 [INFO] uvicorn | Started server process [14722]
09-07 08:35:55 [INFO] uvicorn | Waiting for application startup.
09-07 08:35:55 [INFO] uvicorn | Application startup complete.
09-07 08:35:55 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
09-07 09:36:23 [SUCCESS] nonebot | OneBot V11 0 | [message.private.friend]: Message 1 from 1 "/echo test"
09-07 09:36:23 [DEBUG] nonebot | Checking for matchers in priority 1...
09-07 09:36:23 [INFO] nonebot | Event will be handled by Matcher(type='message', module=plugins.xxx_plugin)
09-07 09:36:23 [DEBUG] nonebot | Running Matcher(type='message', module=plugins.xxx_plugin)
09-07 09:36:23 [DEBUG] nonebot | Running handler Dependent(call=handle)
09-07 09:36:23 [DEBUG] nonebot | Handler Dependent(call=handle) skipped
09-07 09:36:23 [INFO] nonebot | Matcher(type='message', module=plugins.xxx_plugin) running complete
09-07 09:36:23 [INFO] nonebot | Event will be handled by Matcher(type='message', module=nonebot.plugins.echo)
09-07 09:36:23 [DEBUG] nonebot | Running Matcher(type='message', module=nonebot.plugins.echo)
09-07 09:36:23 [DEBUG] nonebot | Running handler Dependent(call=handle_echo)
09-07 09:36:23 [DEBUG] nonebot | OneBot V11 | Calling API send_msg
09-07 09:36:23 [INFO] nonebot | Matcher(type='message', module=nonebot.plugins.echo) running complete
09-07 08:38:01 [INFO] uvicorn | Shutting down
09-07 08:38:01 [INFO] uvicorn | Waiting for application shutdown.
09-07 08:38:01 [INFO] uvicorn | Application shutdown complete.
09-07 08:38:01 [INFO] uvicorn | Finished server process [14722]

@yanyongyu yanyongyu added the enhancement New feature or request label Sep 7, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2022

🚀 Deployed on https://deploy-preview-1233--nonebot2.netlify.app

@github-actions github-actions bot temporarily deployed to pull request September 7, 2022 11:18 Inactive
@codecov
Copy link

codecov bot commented Sep 7, 2022

Codecov Report

Merging #1233 (40b7e45) into master (c6eef06) will increase coverage by 0.31%.
The diff coverage is 85.71%.

@@            Coverage Diff             @@
##           master    #1233      +/-   ##
==========================================
+ Coverage   85.12%   85.43%   +0.31%     
==========================================
  Files          41       41              
  Lines        3213     3179      -34     
==========================================
- Hits         2735     2716      -19     
+ Misses        478      463      -15     
Flag Coverage Δ
unittests 85.43% <85.71%> (+0.31%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
nonebot/drivers/aiohttp.py 46.66% <ø> (+1.01%) ⬆️
nonebot/drivers/httpx.py 79.16% <ø> (+6.08%) ⬆️
nonebot/drivers/quart.py 89.28% <ø> (+1.25%) ⬆️
nonebot/drivers/websockets.py 67.90% <ø> (+1.63%) ⬆️
nonebot/internal/adapter/adapter.py 58.53% <ø> (ø)
nonebot/internal/adapter/template.py 91.13% <ø> (ø)
nonebot/internal/driver/model.py 65.18% <0.00%> (ø)
nonebot/internal/permission.py 95.34% <ø> (ø)
nonebot/internal/rule.py 94.44% <ø> (ø)
nonebot/permission.py 100.00% <ø> (ø)
... and 25 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions github-actions bot temporarily deployed to pull request September 7, 2022 11:38 Inactive
@github-actions github-actions bot temporarily deployed to pull request September 8, 2022 02:57 Inactive
@github-actions github-actions bot temporarily deployed to pull request September 8, 2022 03:21 Inactive
@github-actions github-actions bot temporarily deployed to pull request September 8, 2022 03:49 Inactive
@yanyongyu yanyongyu linked an issue Sep 9, 2022 that may be closed by this pull request
@github-actions github-actions bot temporarily deployed to pull request September 9, 2022 03:33 Inactive
@yanyongyu yanyongyu merged commit 8c42490 into master Sep 9, 2022
@yanyongyu yanyongyu deleted the feat/reduce-log branch September 9, 2022 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

Feature: 将部分内置的日志信息等级下调
1 participant