<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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"