import logging


def get_string_from_comment(comment):
    """Extract a string from a comment formatted like this:
       '/u/<username> string' or
       '/u/<username>
        string' """
    lines = comment.body.split("\n")
    try:
        if lines[0] != "/u/check_em_out":
            assert lines[0].startswith("/u/check_em_out")
            return lines[0][16:]
        else:
            if lines[1] != "":
                return lines[1]
            else:
                return lines[2]
    except:
        logging.error("Error getting source channel from comment "+comment.id+".")
        return None