Address various feedback about Rich #4702

Closed
opened 2020-12-29 21:13:59 +01:00 by Jackenmen · 4 comments
Jackenmen commented 2020-12-29 21:13:59 +01:00 (Migrated from github.com)

Making this issue to make this trackable, here's some actual discussion:
https://discord.com/channels/133049272517001216/718148684629540905/793565318940721272

And an example screenshot showing the issue with visibility of blue color on Windows 10 (this is already using the new cmd color scheme, so it is important that we don't neglect this) that is currently used for numbers and INFO log level (and possibly other things):
image

Making this issue to make this trackable, here's some actual discussion: https://discord.com/channels/133049272517001216/718148684629540905/793565318940721272 And an example screenshot showing the issue with visibility of blue color on Windows 10 (this is already using the new cmd color scheme, so it is important that we don't neglect this) that is currently used for numbers and INFO log level (and possibly other things): ![image](https://user-images.githubusercontent.com/6032823/103311403-912a3680-4a1a-11eb-8151-660a5632f6ed.png)
synrg commented 2021-01-10 17:23:07 +01:00 (Migrated from github.com)

Something funny is happening when using repl with the dev cog. When I log via my cog's logger, the whole log message, with ansi color codes in it, gets returned from the repl. I expected those messages to continue to be logged to the console instead.

Here's an example:

cog = bot.get_cog("iNat")
import logging
log = logging.getLogger("red.dronefly.inatcog")
log.setLevel("DEBUG")
log("test")

I get this:

image

When I restart the bot with --dev --force-disable-rich-logging instead, the above test executed in repl results in a DEBUG log message to the console, as expected.

Something funny is happening when using repl with the dev cog. When I log via my cog's logger, the whole log message, with ansi color codes in it, gets returned from the repl. I expected those messages to continue to be logged to the console instead. Here's an example: ```py cog = bot.get_cog("iNat") import logging log = logging.getLogger("red.dronefly.inatcog") log.setLevel("DEBUG") log("test") ``` I get this: ![image](https://user-images.githubusercontent.com/1204376/104128430-d36a4680-533d-11eb-90d5-3a414d37faa3.png) When I restart the bot with `--dev --force-disable-rich-logging` instead, the above test executed in repl results in a DEBUG log message to the console, as expected.
npc203 commented 2021-01-20 19:24:20 +01:00 (Migrated from github.com)

So rich doesn't show the traceback lines completely sometimes.

To reproduce: have any normal command group. but in the subcommand, make the decorator @group.commands().
bg 2

Non - rich version.
bg3

Rich does show the line number. so this doesn't really affect me, but at these cases IMO, i would've preferred non-rich.

The same typo makes rich wonky in normal commands as well @commands.commands()
bug report

This is a minor inconvenience, only made this up, cause it took like a min to find what went wrong cause the decorator's keyword arguments were a lil long in my case and i was checking what went wrong there.

EDIT: minimal reproduce-able code:

class Brokencog(commands.Cog):
    @commands.group()
    async def aaa(self, ctx):
        pass

    @aaa.commands()
    async def asbd(self, ctx):
        pass

and then try loading the cog

So rich doesn't show the traceback lines completely sometimes. To reproduce: have any normal command group. but in the subcommand, make the decorator `@group.commands()`. ![bg 2](https://user-images.githubusercontent.com/50765275/105217238-9c840400-5b79-11eb-810f-db35cd86ee04.PNG) Non - rich version. ![bg3](https://user-images.githubusercontent.com/50765275/105217446-e1a83600-5b79-11eb-81ea-cd0d1ad02ead.PNG) Rich does show the line number. so this doesn't really affect me, but at these cases IMO, i would've preferred non-rich. The same typo makes rich wonky in normal commands as well `@commands.commands()` ![bug report](https://user-images.githubusercontent.com/50765275/105217818-5da27e00-5b7a-11eb-9f41-493463eccff5.PNG) This is a minor inconvenience, only made this up, cause it took like a min to find what went wrong cause the decorator's keyword arguments were a lil long in my case and i was checking what went wrong there. EDIT: minimal reproduce-able code: ```py class Brokencog(commands.Cog): @commands.group() async def aaa(self, ctx): pass @aaa.commands() async def asbd(self, ctx): pass ``` and then try loading the cog
Jackenmen commented 2021-01-20 21:14:46 +01:00 (Migrated from github.com)

This is not reproducible on my machine (code) so I can't fix this and unless someone else can reproduce this and pinpoint the issue (be that something about our configuration, a bug in Rich, or something else) on their own, it will probably remain unfixed.

This is not reproducible on my machine ([code](https://github.com/jack1142/Issue2527TestRepo/tree/blah1/brokencog)) so I can't fix this and unless someone else can reproduce this and pinpoint the issue (be that something about our configuration, a bug in Rich, or something else) on their own, it will probably remain unfixed.
Jackenmen commented 2021-01-23 17:38:45 +01:00 (Migrated from github.com)

It appears that the issue from npc203 got fixed in the latest release of Rich (9.9.0) and this fix will be included in #4726.

It appears that the issue from npc203 got fixed in the latest release of Rich (9.9.0) and this fix will be included in #4726.
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#4702
No description provided.