# $language = "Python" # $interface = "1.0" msgbox = crt.Dialog.MessageBox prompt = crt.Dialog.Prompt def main(): objConfig = crt.Session.Config nCurTraceLevel = objConfig.GetOption("Trace Level") strPrompt = "Session Name: {0}\r\nCurrent Trace Level: {1}\r\n\r\nSpecify new Trace Level:".format(crt.Session.Path, nCurTraceLevel) if nCurTraceLevel != 0: nNewDefault = 0 else: nNewDefault = 8 nNewTraceLevel = prompt(strPrompt, "Trace", str(nNewDefault)) if nNewTraceLevel == "": return 1; objConfig.SetOption("Trace Level", int(nNewTraceLevel)) msgbox("Trace level '{0}' is now: ".format(crt.Session.Path) + str(objConfig.GetOption("Trace Level")) + "\r\r" + "You must disconnect and reconnect in order for the new trace level to take effect.") # If Auto Save is enabled (it is by default), the following line is not needed. # However, in the event that Auto Save is not enabled, we call Save() to ensure # that the trace level change is saved for the subsequent connection attempt. objConfig.Save() main();