log dice rolls
This commit is contained in:
parent
7dbe30a411
commit
826f34e866
@ -1,9 +1,12 @@
|
|||||||
"""Functions for use in the dice module."""
|
"""Functions for use in the dice module."""
|
||||||
|
import logging
|
||||||
import random
|
import random
|
||||||
|
|
||||||
import ply.lex as lex
|
import ply.lex as lex
|
||||||
import ply.yacc as yacc
|
import ply.yacc as yacc
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class DiceRoller(object):
|
class DiceRoller(object):
|
||||||
|
|
||||||
@ -257,6 +260,7 @@ class DiceRoller(object):
|
|||||||
dS: roll a S-sided die
|
dS: roll a S-sided die
|
||||||
+M: add M to the result (-M for subtraction) (optional)
|
+M: add M to the result (-M for subtraction) (optional)
|
||||||
"""
|
"""
|
||||||
|
logger.info("rolling {0:s}".format(dicestr))
|
||||||
yacc.parse(dicestr)
|
yacc.parse(dicestr)
|
||||||
return self.get_result()
|
return self.get_result()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user