action='store', choices=['info', 'debug', 'warning', 'error', 'critical'], default='info', required=False) parser.add_argument( '-lcon', '--levelConsole', help= 'Logging level: Set the level of the message for the console logger, default: Debug level', action='store', choices=['info', 'debug', 'warning', 'error', 'critical'], default='info', required=False) parser.add_argument('moduleName', help='The name of the IAS module to create') args = parser.parse_args() stdoutLevel = args.levelStdOut consoleLevel = args.levelConsole logger = Log.initLogging(__file__, stdoutLevel, consoleLevel) if args.erase: try: ModuleSupport.removeExistingModule(args.moduleName) except Exception as e: logger.error("Error deleting the module: %s", str(e)) exit(-1) try: ModuleSupport.createModule(args.moduleName) except Exception as e: logger.error("Error creating the module: %s", str(e)) exit(-1)
time.sleep(0.05) for ant in UMStates: mPointName = buildUMStatusMPointName(ant) udpPlugin.submit(mPointName, UMStates[ant], "STRING", timestamp=datetime.utcnow(), operationalMode='OPERATIONAL') logger.info("Sent %s with value %s", mPointName, UMStates[ant]) time.sleep(0.05) logger.info("Iteration done") if __name__ == "__main__": logger = Log.initLogging(__file__) # Get the UDP port number from the command line if len(sys.argv) != 3: logger.error( "UDP port and loop time (seconds) expected in command line") sys.exit(-1) try: udpPort = int(sys.argv[1]) except ValueError: logger.error("Invalid port number %s", (sys.argv[1])) sys.exit(-2) logger.info("Will send alarms to UDP port %d", udpPort) try: loopSecs = int(sys.argv[2])
from IASTools.CommonDefs import CommonDefs from IASLogging.logConf import Log import os if __name__ == '__main__': parser = argparse.ArgumentParser(description='Get the classpath.') parser.add_argument( '-lso', '--levelStdOut', help= 'Logging level: Set the level of the message for the file logger, default: Debug level', action='store', choices=['info', 'debug', 'warning', 'error', 'critical'], default='info', required=False) parser.add_argument( '-lcon', '--levelConsole', help= 'Logging level: Set the level of the message for the console logger, default: Debug level', action='store', choices=['info', 'debug', 'warning', 'error', 'critical'], default='info', required=False) args = parser.parse_args() stdoutLevel = args.levelStdOut consoleLevel = args.levelConsole logger = Log.initLogging(os.path.basename(__file__), stdoutLevel, consoleLevel) logger.info(CommonDefs.buildClasspath())