Dedicated logger for updates
This commit is contained in:
parent
e172346c3b
commit
8d1ecc030d
2 changed files with 4 additions and 7 deletions
|
@ -77,7 +77,7 @@ class BotutilCog(Scale):
|
|||
|
||||
@msg_command(name="update")
|
||||
async def _update(self, ctx: MessageContext) -> None:
|
||||
status = await update(self.bot, self.logger)
|
||||
status = await update(self.bot)
|
||||
if status:
|
||||
console = Console()
|
||||
with console.capture() as capture:
|
||||
|
|
|
@ -17,10 +17,10 @@ from rich.table import Table
|
|||
import jarvis.cogs
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from logging import Logger
|
||||
|
||||
from dis_snek.client.client import Snake
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
class UpdateResult:
|
||||
|
@ -105,19 +105,16 @@ def get_git_changes() -> dict:
|
|||
}
|
||||
|
||||
|
||||
async def update(bot: "Snake", logger: "Logger" = None) -> Optional[UpdateResult]:
|
||||
async def update(bot: "Snake") -> Optional[UpdateResult]:
|
||||
"""
|
||||
Update JARVIS and return an UpdateResult.
|
||||
|
||||
Args:
|
||||
bot: Bot instance
|
||||
logger: Logger instance
|
||||
|
||||
Returns:
|
||||
UpdateResult object
|
||||
"""
|
||||
if not logger:
|
||||
logger = logging.getLogger(__name__)
|
||||
repo = git.Repo(".")
|
||||
current_hash = repo.head.object.hexsha
|
||||
origin = repo.remotes.origin
|
||||
|
|
Loading…
Add table
Reference in a new issue