from typing import Union
import logging


def get_level(level:Union[str,int]) -> str:
    """Return the logging level as a string"""
    if isinstance(level, str):
        return level.upper()
    return logging.getLevelName(level)