import os
import isystem.connect as ic
winidea_id = ''
def test_logger():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
print(f"Current logger ID: {connMgr.getId()}")
print("Initialize new logger...")
connMgr.initLogger("test_logger", "test_logger_out.py", ic.CLogger.PYTHON)
logger = connMgr.getLogger()
logger.setIndent(2)
logger.createVar("someInt", "int")
logger.log("someInt = 42")
logger.log("main()")
logger.logc("my visible comment")
logger.loggingOff()
logger.logc("will not be visible")
logger.loggingOn()
logger.closeLog("# end comment")
filePath = "test_logger_out.py"
print(f"Content of the created log file: {filePath}")
with open(filePath, "r") as fHandler:
print("'''")
print(fHandler.read())
print("'''")
if __name__ == "__main__":
test_logger()