Merge "Issue #2504 Add hostname to log path for GFESuite scripts" into omaha_14.2.1
Former-commit-id:3ea333df82
[formerlyf958ea6d0c
] [formerly3ea333df82
[formerlyf958ea6d0c
] [formerlyddccf45e86
[formerly 99e1c39e8e7b98934f42a819128cc9700f976178]]] Former-commit-id:ddccf45e86
Former-commit-id:4905c89acf
[formerlybb0e9dc3cc
] Former-commit-id:ed4d391879
This commit is contained in:
commit
e04cc1e151
1 changed files with 8 additions and 8 deletions
|
@ -19,7 +19,7 @@
|
|||
##
|
||||
|
||||
import string, IrtAccess, JUtil, logging
|
||||
import xml, pickle, tempfile, os
|
||||
import xml, pickle, tempfile, os, socket
|
||||
from xml.etree import ElementTree
|
||||
from xml.etree.ElementTree import Element, SubElement
|
||||
import LogStream
|
||||
|
@ -50,7 +50,7 @@ from com.raytheon.uf.common.localization import LocalizationContext_Localization
|
|||
# 03/11/13 1759 dgilling Move siteConfig import into
|
||||
# methods where it's needed.
|
||||
# 11/07/13 2517 randerso Allow getLogger to override logLevel
|
||||
#
|
||||
# 01/22/14/ 2504 randerso Added hostname to log path
|
||||
#
|
||||
#
|
||||
|
||||
|
@ -285,17 +285,17 @@ def getLogger(scriptName, logName=None, logLevel=logging.INFO):
|
|||
# modify its include path with the proper siteConfig just before
|
||||
# execution time
|
||||
import siteConfig
|
||||
|
||||
hostname = socket.gethostname().split('.')[0]
|
||||
logPath = os.path.join(siteConfig.GFESUITE_LOGDIR, strftime("%Y%m%d", gmtime()), hostname)
|
||||
if logName is None:
|
||||
logPath = siteConfig.GFESUITE_LOGDIR + "/" + strftime("%Y%m%d", gmtime())
|
||||
logName = scriptName + ".log"
|
||||
else:
|
||||
logPath = os.path.dirname(logName)
|
||||
if len(logPath) == 0:
|
||||
logPath = siteConfig.GFESUITE_LOGDIR + "/" + strftime("%Y%m%d", gmtime())
|
||||
logDir = os.path.dirname(logName)
|
||||
if len(logDir) > 0:
|
||||
logPath = logDir
|
||||
logName = os.path.basename(logName)
|
||||
|
||||
logFile = logPath + "/" + logName
|
||||
logFile = os.path.join(logPath, logName)
|
||||
|
||||
if not os.path.exists(logPath):
|
||||
os.makedirs(logPath)
|
||||
|
|
Loading…
Add table
Reference in a new issue