Commits

mickael9 committed b23014b

Add nolog tag

  • Participants
  • Parent commits 5d58885

Comments (0)

Files changed (2)

config.py.example

 UMASK = 022
 FILE_ENCODING = 'utf-8'
 
+NOLOG_TAG = '[nolog]'
+
 TIME_FORMAT = '[%H:%M:%S] '
 LOGFILE = 'logs/%(name)s/%m/%d.log'
 CHANNELS = ['#foo', '#bar']
 import sys, os
 
 from config import UMASK, FILE_ENCODING, TIME_FORMAT, \
-        LOGFILE, CHANNELS, SERVER, NICK
+        LOGFILE, CHANNELS, SERVER, NICK, NOLOG_TAG
 
 class LogWriter(object):
     name = None
             self.join(channel)
 
     def on_channel_message(self, umask, channel, message):
+        if message.endswith(NOLOG_TAG):
+            return
+
         self.log_event(channel, '<%s> %s' % (umask.nick, message))
 
     def on_action(self, umask, target, message):
+        if message.endswith(NOLOG_TAG):
+            return
         self.log_event(target, '(Action) %s %s' % (umask.nick, message))
 
     def on_server_join(self, umask, channel):