From 826f34e86649a4ad2fc306e21ec7e99496732b72 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Wed, 17 Jan 2018 10:30:44 -0600 Subject: [PATCH] log dice rolls --- dice/lib.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dice/lib.py b/dice/lib.py index ba5c434..78a93c6 100644 --- a/dice/lib.py +++ b/dice/lib.py @@ -1,9 +1,12 @@ """Functions for use in the dice module.""" +import logging import random import ply.lex as lex import ply.yacc as yacc +logger = logging.getLogger(__name__) + class DiceRoller(object): @@ -257,6 +260,7 @@ class DiceRoller(object): dS: roll a S-sided die +M: add M to the result (-M for subtraction) (optional) """ + logger.info("rolling {0:s}".format(dicestr)) yacc.parse(dicestr) return self.get_result()