source: tmcsimulator/trunk/src/python/unifiedlogger/__main__.py @ 452

Revision 452, 593 bytes checked in by jdalbey, 7 years ago (diff)

Enhance unified logger to use a placeholder for revision number if config file not found.

Line 
1import logging_service, os, ConfigParser
2# This main module is provided so the application can be conveniently bundled for deployment
3def main():
4    # get revision number from configuration
5    config = ConfigParser.ConfigParser()
6    try:
7        config.read('config/application_properties.cf')
8        revNum = config.get('Versions', 'revision_number')
9    except:  # If config file not found, use a question mark placeholder
10        revNum = "?"
11    print "Unified Logging Service v"+revNum,"starting from ",os.getcwd()
12    logging_service.startup()
13
14if __name__ == '__main__':
15    main()
Note: See TracBrowser for help on using the repository browser.