source: branches/testScripts/NBlogMessages.py @ 740

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

Added comment about licensing

  • Property svn:eol-style set to native
File size: 989 bytes
RevLine 
[615]1#! /usr/bin/env python
2
[718]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
[615]8import time
9
[710]10execfile('NBuserParametersDefault.py')
11execfile('NBuserParameters.py')
12
[668]13#TODO: one could open the logfile once in the beginning, set it to sys.stdout, flush after each message, and close it finally
[615]14
15#------------------------------------------------------------------------
16# Function to write log messages
17#------------------------------------------------------------------------
[616]18def writeMessage( msg ) :
[615]19  logMsg = time.ctime(time.time())+': '
20  logMsg += msg
[710]21  if LOGPRINT :
[668]22    print logMsg
[710]23  if len(LOGFILE) > 0 and not LOGFILE.isspace() :
24    logfile=open(NIGHTLY_BUILD_ROOT_DIR+'/'+LOGFILE, 'a')
[668]25    logfile.write(logMsg+'\n')
26#    logfile.flush()
27    logfile.close()
Note: See TracBrowser for help on using the repository browser.