From 7e1a6e108ea804fc3a35601d8740cc555f3db6ed Mon Sep 17 00:00:00 2001 From: bobloy Date: Fri, 18 Sep 2020 17:02:37 -0400 Subject: [PATCH] Logs mainly --- werewolf/builder.py | 3 +++ werewolf/game.py | 3 +++ werewolf/night_powers.py | 4 ++++ werewolf/player.py | 4 ++++ werewolf/role.py | 5 +++++ werewolf/votegroup.py | 5 +++++ werewolf/werewolf.py | 4 ++++ 7 files changed, 28 insertions(+) diff --git a/werewolf/builder.py b/werewolf/builder.py index 1648b45..4632a21 100644 --- a/werewolf/builder.py +++ b/werewolf/builder.py @@ -1,4 +1,5 @@ import bisect +import logging from collections import defaultdict from random import choice @@ -13,6 +14,8 @@ from .roles.vanillawerewolf import VanillaWerewolf from .roles.villager import Villager from redbot.core.utils.menus import menu, prev_page, next_page, close_menu +log = logging.getLogger("red.fox_v3.werewolf.builder") + # All roles in this list for iterating ROLE_LIST = sorted([Villager, Seer, VanillaWerewolf], key=lambda x: x.alignment) diff --git a/werewolf/game.py b/werewolf/game.py index 95807a1..7c6a5c8 100644 --- a/werewolf/game.py +++ b/werewolf/game.py @@ -1,4 +1,5 @@ import asyncio +import logging import random from typing import List, Any, Dict, Set, Union @@ -10,6 +11,8 @@ from .player import Player from .role import Role from .votegroup import VoteGroup +log = logging.getLogger("red.fox_v3.werewolf.game") + class Game: """ diff --git a/werewolf/night_powers.py b/werewolf/night_powers.py index b50929b..a39ad26 100644 --- a/werewolf/night_powers.py +++ b/werewolf/night_powers.py @@ -1,5 +1,9 @@ +import logging + from .role import Role +log = logging.getLogger("red.fox_v3.werewolf.night_powers") + def night_immune(role: Role): role.player.alive = True diff --git a/werewolf/player.py b/werewolf/player.py index c84d87f..8ee437e 100644 --- a/werewolf/player.py +++ b/werewolf/player.py @@ -1,5 +1,9 @@ +import logging + import discord +log = logging.getLogger("red.fox_v3.werewolf.player") + class Player: """ diff --git a/werewolf/role.py b/werewolf/role.py index af2d38b..8c4d989 100644 --- a/werewolf/role.py +++ b/werewolf/role.py @@ -1,3 +1,8 @@ +import logging + +log = logging.getLogger("red.fox_v3.werewolf.role") + + class Role: """ Base Role class for werewolf game diff --git a/werewolf/votegroup.py b/werewolf/votegroup.py index a754247..d60f451 100644 --- a/werewolf/votegroup.py +++ b/werewolf/votegroup.py @@ -1,3 +1,8 @@ +import logging + +log = logging.getLogger("red.fox_v3.werewolf.votegroup") + + class VoteGroup: """ Base VoteGroup class for werewolf game diff --git a/werewolf/werewolf.py b/werewolf/werewolf.py index 1f8fc3f..c90982f 100644 --- a/werewolf/werewolf.py +++ b/werewolf/werewolf.py @@ -1,3 +1,5 @@ +import logging + import discord from redbot.core import Config, checks, commands from redbot.core.bot import Red @@ -13,6 +15,8 @@ from .builder import ( ) from .game import Game +log = logging.getLogger("red.fox_v3.werewolf") + class Werewolf(Cog): """