source: branches/testScripts/NBlogMessages.py @ 740

Last change on this file since 740 was 718, checked in by jpfasano, 12 years ago

Added comment about licensing

  • Property svn:eol-style set to native
File size: 989 bytes
Line 
1#! /usr/bin/env python
2
3#------------------------------------------------------------------------
4# This file is distributed under the Common Public License.
5# It is part of the BuildTools project in COIN-OR (www.coin-or.org)
6#------------------------------------------------------------------------
7
8import time
9
10execfile('NBuserParametersDefault.py')
11execfile('NBuserParameters.py')
12
13#TODO: one could open the logfile once in the beginning, set it to sys.stdout, flush after each message, and close it finally
14
15#------------------------------------------------------------------------
16# Function to write log messages
17#------------------------------------------------------------------------
18def writeMessage( msg ) :
19  logMsg = time.ctime(time.time())+': '
20  logMsg += msg
21  if LOGPRINT :
22    print logMsg
23  if len(LOGFILE) > 0 and not LOGFILE.isspace() :
24    logfile=open(NIGHTLY_BUILD_ROOT_DIR+'/'+LOGFILE, 'a')
25    logfile.write(logMsg+'\n')
26#    logfile.flush()
27    logfile.close()
Note: See TracBrowser for help on using the repository browser.