try:
    from icecraeam import ic
except:
    print()
    print("#===================================================")
    print("# Warning: module icecream could not be imported")
    print("#    Use tklib.tkicecream")
    print("#===================================================")
    print()

    tkice_dict = {"is_enabled": True}

    def ic(*args):
        if not tkice_dict["is_enabled"]: return None
        
        outputFunction = tkice_dict.get("outputFunction", None)
        if outputFunction is not None:
            return outputFunction(*args)

        prefix = tkice_dict.get("prefix", None)
        if prefix is not None: print(prefix, end = '')
        print("tkic:", end = '')

        print(*args)

        return None

    def ic_disable():
        tkice_dict["is_enabled"] = False

    def ic_enable():
        tkice_dict["is_enabled"] = True

    def ic_configureOutput(**kwargs):
        for key, val in kwargs.items():
            tkice_dict[key] = val

    def ic_format(*args):
        return args

    ic.disable = ic_disable
    ic.enable = ic_enable
    ic.configureOutput = ic_configureOutput
    ic.format = ic_format
