<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def log(logger, level, message):
 """Logs message to stderr if logging isn't initialized."""


    if logger.parent.name != 'root':
        logger.log(level, message)
    else:
        print(message, file=sys.stderr)