[PR #1] [MERGED] Logger improvements with loguru #1

Closed
opened 2025-11-11 12:37:49 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/KohakuBlueleaf/KohakuHub/pull/1
Author: @ntrwansuiBC
Created: 10/24/2025
Status: Merged
Merged: 10/25/2025
Merged by: @KohakuBlueleaf

Base: mainHead: main


📝 Commits (1)

  • 980c146 update: now logger.py based on loguru.

📊 Changes

7 files changed (+481 additions, -151 deletions)

View changed files

📝 .gitignore (+1 -0)
📝 config-example.toml (+4 -0)
📝 pyproject.toml (+1 -0)
📝 scripts/generate_docker_compose.py (+3 -0)
📝 src/kohakuhub/config.py (+10 -0)
📝 src/kohakuhub/logger.py (+139 -151)
src/kohakuhub/old_logger.py (+323 -0)

📄 Description

Pull Request

What changed?

基于Loguru重写logger
现在如果app.log_format被设置为file
则日志文件会被输出至app.log_dir/kohakuhub.log下

使用InterceptHandler接管其他类库的日志

Why?

Fixes #

Testing

  • [*] Tested locally
  • Tested in Docker (if relevant)

Checklist

  • [*] Code follows project style (see CONTRIBUTING.md)
  • Updated docs if needed (README, API.md, CLI.md, etc.)
  • [*] No breaking changes (or documented them)
  • [*] Tested my changes

Screenshots

3390c4ef-326d-4c39-bc41-3df0e504476f 51c22840-ef95-4f8d-a583-765c2b096397

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/KohakuBlueleaf/KohakuHub/pull/1 **Author:** [@ntrwansuiBC](https://github.com/ntrwansuiBC) **Created:** 10/24/2025 **Status:** ✅ Merged **Merged:** 10/25/2025 **Merged by:** [@KohakuBlueleaf](https://github.com/KohakuBlueleaf) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`980c146`](https://github.com/KohakuBlueleaf/KohakuHub/commit/980c1462c14e4a8d0b0643f467a7a398d838e60a) update: now logger.py based on loguru. ### 📊 Changes **7 files changed** (+481 additions, -151 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -0) 📝 `config-example.toml` (+4 -0) 📝 `pyproject.toml` (+1 -0) 📝 `scripts/generate_docker_compose.py` (+3 -0) 📝 `src/kohakuhub/config.py` (+10 -0) 📝 `src/kohakuhub/logger.py` (+139 -151) ➕ `src/kohakuhub/old_logger.py` (+323 -0) </details> ### 📄 Description # Pull Request ## What changed? 基于Loguru重写logger 现在如果app.log_format被设置为file 则日志文件会被输出至app.log_dir/kohakuhub.log下 使用InterceptHandler接管其他类库的日志 ## Why? <!-- Why are you making this change? Link related issues --> Fixes # ## Testing <!-- How did you test this? --> - [*] Tested locally - [ ] Tested in Docker (if relevant) ## Checklist - [*] Code follows project style (see CONTRIBUTING.md) - [ ] Updated docs if needed (README, API.md, CLI.md, etc.) - [*] No breaking changes (or documented them) - [*] Tested my changes ## Screenshots <!-- If UI changes, add before/after screenshots --> <img width="1339" height="617" alt="3390c4ef-326d-4c39-bc41-3df0e504476f" src="https://github.com/user-attachments/assets/58c4e9ec-889a-44e7-9a99-811b5e588753" /> <img width="1363" height="515" alt="51c22840-ef95-4f8d-a583-765c2b096397" src="https://github.com/user-attachments/assets/8516507e-7ab8-4c38-b319-47f99a173fcf" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-11 12:37:49 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/KohakuHub#1