feat(logging): Add locale to log info.
This commit is contained in:
@@ -6,6 +6,7 @@ from typing import Optional, TYPE_CHECKING
|
||||
import discord
|
||||
from discord.enums import ChannelType
|
||||
from discord.ext.commands import Context
|
||||
from babel.translator import ctx_locale
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .LionBot import LionBot
|
||||
@@ -79,6 +80,7 @@ class LionContext(Context['LionBot']):
|
||||
parts['alias'] = f"\"{self.invoked_with}\""
|
||||
if self.command_failed:
|
||||
parts['failed'] = self.command_failed
|
||||
parts['locale'] = f"\"{ctx_locale.get()}\""
|
||||
|
||||
return "<LionContext: {}>".format(
|
||||
' '.join(f"{name}={value}" for name, value in parts.items())
|
||||
|
||||
Reference in New Issue
Block a user