Ignore:
Timestamp:
09/01/2022 01:12:20 PM (4 years ago)
Author:
jdalbey
Message:

activitylog_watcher.py updated to read log filenames from config file.

File:
1 edited

Legend:

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

    r644 r645  
    4545    config.read('config/logging_service.cfg') 
    4646    return config.get('Paths', 'ActivityLogPath') 
     47 
     48# get data filenames from configuration 
     49# returns incident data filename, incident summary filename 
     50# jdalbey 2022.9.1 
     51def getLogFilenames(): 
     52    config = ConfigParser.ConfigParser() 
     53    config.read('config/logging_service.cfg') 
     54    file1 = config.get('Files','ActivityLogDataFilename') 
     55    file2 = config.get('Files','ActivityLogSummaryFilename') 
     56    return file1,file2 
    4757     
    4858# Read the activty log entries  
    4959def readFile1(): 
    50     logfilename = "incident_activity.json"   #"IncidentActivity.log" 
     60    logfilename = getLogFilenames()[0]  #"IncidentActivity.log" 
    5161    output = [] 
    5262    try:   
     
    6474# It has a different format than incident_activity.json, so we put it in a separate function. 
    6575def readFile2(): 
    66     data_summary = "incident_description.json" 
     76    data_summary = getLogFilenames()[1] #"incident_description.json" 
     77 
    6778    output = [] 
    6879    try:   
Note: See TracChangeset for help on using the changeset viewer.