def execute(self):
        if not self.args:
            self.pc.update_output('Type "help log" for help with this command.')
            return
        if not self.pc.location:
            self.pc.update_output('There aren\'t any npcs in the void to log.')
            return
        npc = self.pc.location.get_npc_by_kw(self.args.lower().strip())
        if not npc:
            self.pc.update_output('That npc doesn\'t exist.')
            return
        string = (' Log for %s ' % npc.name).center(50, '-') + '\n'
        perms = ', '.join(get_permission_names(npc.permissions))
        if npc.remember:
            string += 'REMEMBERS: '
            string += ', '.join(npc.remember) + '\n'
        else:
            string += 'REMEMBERS: This npc doesn\'t remember any players.\n'
        string += 'PERMISSIONS: ' + perms + '\n'
        string += 'ACTION LOG:\n'
        if npc.actionq:
            string += '\n'.join([a.strip('\n').strip('\r') for a in npc.actionq])
        else:
            string += 'Action log is empty.'
        string += '\n' + ('-' * 50)
        self.pc.update_output(string)
dataset/ETHPy150Open shinymud/ShinyMUD/src/shinymud/commands/commands.py/Log.execute/original