Version 1.2 (June 2013)
 All Classes Namespaces Files Functions Variables Pages
Static Public Member Functions | Static Public Attributes | List of all members
utils.LogFile Class Reference

Creates and updates a log file for the running simulation. More...

Static Public Member Functions

static void openFile (String dirName)
 Open a logFile at a specified directory, and initialises the time recorder. More...
 
static void writeLogAlways (String message)
 Static method to add message to the log file, even when quiet mode is enabled. More...
 
static void writeLog (String message)
 Static method to add message to the log file, so long as Idynomics.quietMode is false (default) More...
 
static void writeMatrix (String name, Matrix M)
 Write a data matrix of a given name into the log file. More...
 
static void writeError (String message, String origin)
 Static method to add a specific error message to the log file. More...
 
static void closeFile ()
 Closes the log file. More...
 
static void reopenFile ()
 Closes and reopens the log file in append mode to ensure log file updates are kept when disk is not writeable. More...
 
static void chronoMessageIn (String message)
 Output a log message with the current time. More...
 
static void chronoMessageIn ()
 
static long chronoMessageOut (String message)
 Writes a message into the log file with the time taken to perform an action. More...
 
static long chronoMessageOut ()
 Determine the amount of time that has passed between two timepoints and return. More...
 
static void writeEndOfStep (double length)
 Writes log message at the end of the step summarising the computational time taken in this step. More...
 
static String getDateFileName ()
 Returns the date and time as a string for use in constructing the log file title. More...
 

Static Public Attributes

static FileOutputStream log
 
static long anInstant
 

Detailed Description

Creates and updates a log file for the running simulation.

Creates and updates a log file for the running simulation

Member Function Documentation

static void utils.LogFile.chronoMessageIn ( String  message)
static

Output a log message with the current time.

Output a log message with the current time

Parameters
messageMessage to be appended into the log file
static void utils.LogFile.chronoMessageIn ( )
static

Determine the current time.

static long utils.LogFile.chronoMessageOut ( String  message)
static

Writes a message into the log file with the time taken to perform an action.

Writes a message into the log file with the time taken to perform an action

Parameters
messageThe message to be appended into the log file
Returns
The amount of time taken to perform an action
static long utils.LogFile.chronoMessageOut ( )
static

Determine the amount of time that has passed between two timepoints and return.

Determine the amount of time that has passed between two timepoints and return

Returns
Long value noting the milliseconds difference between two timepoints
static void utils.LogFile.closeFile ( )
static

Closes the log file.

Closes the log file

static String utils.LogFile.getDateFileName ( )
static

Returns the date and time as a string for use in constructing the log file title.

Returns the date and time as a string for use in constructing the log file title

Returns
String containing the year,month,day,underscore,hour, and minute, for appending to the log file name
static void utils.LogFile.openFile ( String  dirName)
static

Open a logFile at a specified directory, and initialises the time recorder.

Open a logFile at a specified directory, and initialises the time recorder

Parameters
dirNameDirectory where the log file should be stored
static void utils.LogFile.reopenFile ( )
static

Closes and reopens the log file in append mode to ensure log file updates are kept when disk is not writeable.

Added by bvm added 03.09.09. Method to close and reopen the log file in append mode, to try and keep logfile updates even when disk location is not writeable

static void utils.LogFile.writeEndOfStep ( double  length)
static

Writes log message at the end of the step summarising the computational time taken in this step.

Writes log message at the end of the step summarising the computational time taken in this step

Parameters
lengthLength of time in hours that it has taken to perform this step
static void utils.LogFile.writeError ( String  message,
String  origin 
)
static

Static method to add a specific error message to the log file.

Static method to add a generated error message to the log file

Parameters
messageError message that should be appended to the log file
originString noting the origin of this error
static void utils.LogFile.writeLog ( String  message)
static

Static method to add message to the log file, so long as Idynomics.quietMode is false (default)

Static method to add message to the log file, so long as Idynomics.quietMode is false (default)

Parameters
messageThe message that should be appended to the log file
static void utils.LogFile.writeLogAlways ( String  message)
static

Static method to add message to the log file, even when quiet mode is enabled.

Static method to add message to the log file, even when quiet mode is enabled

Parameters
messageThe message that should be appended to the log file
static void utils.LogFile.writeMatrix ( String  name,
Matrix  M 
)
static

Write a data matrix of a given name into the log file.

Write a data matrix of a given name into the log file

Parameters
nameName of the matrix being written in the log file
MData matrix being written into the log file

Member Data Documentation

long utils.LogFile.anInstant
static

Used to hold simulation time at the time of logging

FileOutputStream utils.LogFile.log
static

Output stream which log messages are written to


The documentation for this class was generated from the following file: