Skip to content

Commit

Permalink
Merge pull request #205 from T-101/feature/optional-command-logging-s…
Browse files Browse the repository at this point in the history
…uppress

Feature/optional command logging suppress
  • Loading branch information
lepinkainen committed May 29, 2017
2 parents f3ec24a + 4806b81 commit b4fbfec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyfibot/botcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from types import FunctionType

import re
import inspect
import string
import logging
from util import pyfiurl
Expand Down Expand Up @@ -407,7 +408,9 @@ def _command(self, user, channel, cmnd):
for cname, command in commands:
if not self.factory.isAdmin(user) and cname.startswith('admin'):
continue
log.info("module command %s called by %s (%s) on %s" % (cname, user, self.factory.isAdmin(user), channel))
i = inspect.getcallargs(command, self, user, channel, cmnd)
if 'silent' not in i:
log.info("module command %s called by %s (%s) on %s" % (cname, user, self.factory.isAdmin(user), channel))
# Defer commands to threads
d = threads.deferToThread(command, self, user, channel, self.factory.to_unicode(args.strip()))
d.addCallback(self.printResult, "command %s completed" % cname)
Expand Down

0 comments on commit b4fbfec

Please sign in to comment.