Converts log level to a string.

        :param level: a log level to convert

        :return: log level name string.

def to_string(level):
        """
        Converts log level to a string.

        :param level: a log level to convert

        :return: log level name string.
        """
        if level == LogLevel.Fatal:
            return "FATAL" 
        if level == LogLevel.Error:
            return "ERROR" 
        if level == LogLevel.Warn:
            return "WARN" 
        if level == LogLevel.Info:
            return "INFO" 
        if level == LogLevel.Debug:
            return "DEBUG" 
        if level == LogLevel.Trace:
            return "TRACE"
        return "UNDEF"