nodes: 0, module; 1, function_definition; 2, function_name:log_message; 3, parameters; 4, block; 5, identifier:self; 6, identifier:user; 7, identifier:message; 8, expression_statement; 9, if_statement; 10, expression_statement; 11, expression_statement; 12, while_statement; 13, comment:"""Log a channel message.
          
          This log acts as a sort of cache so that recent activity can be searched
          by the bot and command modules without querying the database.
          """; 14, call; 15, block; 16, elif_clause; 17, assignment; 18, call; 19, comparison_operator:len(self.message_log) > self._log_size; 20, block; 21, identifier:isinstance; 22, argument_list; 23, expression_statement; 24, not_operator; 25, block; 26, identifier:time; 27, call; 28, attribute; 29, argument_list; 30, call; 31, attribute; 32, delete_statement; 33, identifier:user; 34, identifier:SeshetUser; 35, assignment; 36, call; 37, expression_statement; 38, attribute; 39, argument_list; 40, attribute; 41, identifier:append; 42, tuple; 43, identifier:len; 44, argument_list; 45, identifier:self; 46, identifier:_log_size; 47, subscript; 48, identifier:user; 49, attribute; 50, identifier:isinstance; 51, argument_list; 52, assignment; 53, identifier:datetime; 54, identifier:utcnow; 55, identifier:self; 56, identifier:message_log; 57, identifier:time; 58, identifier:user; 59, identifier:message; 60, attribute; 61, attribute; 62, integer:0; 63, identifier:user; 64, identifier:nick; 65, identifier:user; 66, identifier:IRCstr; 67, identifier:user; 68, call; 69, identifier:self; 70, identifier:message_log; 71, identifier:self; 72, identifier:message_log; 73, identifier:IRCstr; 74, argument_list; 75, identifier:user
code: def log_message(self, user, message):
          """Log a channel message.
          
          This log acts as a sort of cache so that recent activity can be searched
          by the bot and command modules without querying the database.
          """
          
          if isinstance(user, SeshetUser):
              user = user.nick
          elif not isinstance(user, IRCstr):
              user = IRCstr(user)
  
          time = datetime.utcnow()
              
          self.message_log.append((time, user, message))
          
          while len(self.message_log) > self._log_size:
              del self.message_log[0]