Ignore:
Timestamp:
10/02/2022 10:32:42 AM (4 years ago)
Author:
jdalbey
Message:

logging_service.py, et.al. Revise how it handles a missing CADcomments.log file - just skip the file read but continue. Also update all watchers to use config dir.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/python/unifiedlogger/logging_service.py

    r683 r687  
    1212     
    1313# Load the sim time file and extract the seconds */ 
    14 def getSimTime(): 
     14def getSimTime(path): 
    1515    global seconds     
    16     with open ("webapps/dynamicdata/sim_elapsedtime.json", 'r') as myfile: 
     16    with open (path+"sim_elapsedtime.json", 'r') as myfile: 
    1717        jsonData=myfile.read() 
    1818    try:      
     
    3737    config.read(configdir + '/logging_service.cfg') 
    3838    logfilepath  = config.get('Paths', 'UnifiedLogPath') 
    39      
     39 
    4040    # Delete any previously existing output file 
    4141    f = open(logfilepath + outputFilename, "w") 
     
    4949        setupfunc = getattr(plugmodule, 'setup') 
    5050        #Call setup 
    51         setupfunc() 
     51        setupfunc(configdir) 
    5252    #END LOOP 
    5353     
     
    5555    while True: 
    5656    #    Get simulation time 
    57         timeStamp = getSimTime() 
     57        timeStamp = getSimTime(logfilepath) 
    5858    #    Reset Output Buffer 
    5959        output = "" 
     
    6666             
    6767    #        Run the plugin process returning new log entries 
    68             results = getfunc()      
     68            results = getfunc() 
    6969    #       Append simulation time and the log entries to the Output Buffer 
    7070            for item in results: 
     
    8787#END DO 
    8888 
    89 # for unit testing 
     89# Entry point for application 
    9090if __name__ == '__main__': 
    9191    startup(sys.argv) 
Note: See TracChangeset for help on using the changeset viewer.