Issue Number | 3947 |
---|---|
Summary | Adding Tier/Host to Log Class |
Created | 2015-08-04 12:50:07 |
Issue Type | Improvement |
Submitted By | Englisch, Volker (NIH/NCI) [C] |
Assigned To | Shah, Aarti (NIH/NIDDK) [C] [X] |
Status | Closed |
Resolved | 2016-02-09 17:06:49 |
Resolution | Fixed |
Path | /home/bkline/backups/jira/ocecdr/issue.166657 |
When inspecting log files provided by CBIIT from the upper tiers it can be useful having a way to confirm the logs are actually coming from the host we thought the would come from.
Alan suggested to update the LOG class to output this information.
This will be a very small and simple change but it will happen in cdr.py, one of our most actively updated files. Assuming we want to install it in Darwin, I'll hold off making the change until we have the Curie svn branch merged into trunk.
I made two changes:
If a banner is written when opening the log file, I will always write the Tier name beneath it along with the datetime.
If the programmer creates the Log object with logTier=True, I'll also prepend it to each message. The default for logTier is False.
Here is an example of the behaviors. In the first opening there is a banner but logTier is False. In the second there is a banner and logTier is True.
=== Opening Test log ===
: DEV DATETIME: Tue Feb 09 16:45:23 2016
TIER!3504: Tue Feb 09 16:45:23 2016: This is a test msg
!3504: Tue Feb 09 16:45:23 2016: And another
09 16:45:23 2016
Tue Feb =========== Closing Log ===========
=== Opening Test log ===
: DEV DATETIME: Tue Feb 09 16:49:57 2016
TIER:!1452: Tue Feb 09 16:49:57 2016: This is a test msg
DEV:!1452: Tue Feb 09 16:49:57 2016: And another
DEV
09 16:49:57 2016
Tue Feb =========== Closing Log ===========
I am happy to entertain suggestions for improving it.
I've tested this on DEV and it is working as expected. Some of our *.log files are now displaying the tier on which the log file is located.
I confirmed in the Jobmaster.log file that the tier is included in the log file.
Closing ticket.
Elapsed: 0:00:00.001386