@classmethod
        def coloured_access(cls, time, request, code, size, server, who=None):
            if code >= 500:
                command = ColouredWriter.colors['fail']
            elif code >= 400:
                command = ColouredWriter.colors['warning']
            elif code == 301:
                command = ColouredWriter.colors['fail'] # We don't want any 301s from our links...
            elif code >= 300:
                command = ColouredWriter.colors['okgreen']
            elif code >= 200:
                command = ColouredWriter.colors['okblue']
            else:
                command = ColouredWriter.colors['unknown']

            if code in ColouredWriter.status_code_text:
                meaning = ColouredWriter.status_code_text[code]
            else:
                meaning = "*unknown*"

            endc = ColouredWriter.colors['endc']
            if who is None:
                line = "%s %s %s%s%s %i %i (%s)\n" % (server[:3], time, command, request, endc, code, size, meaning)
            else:
                line = "%s %s %s %s%s%s %i %i (%s)\n" % \
                    (server[:3], time, who, command, request, endc, code, size, meaning)
            return line
Generate a consistent coloured response.
dataset/ETHPy150Open turbulenz/turbulenz_tools/turbulenz_tools/utils/coloured_writer.py/ColouredWriter.coloured_access