Module fmeobjects :: Class FMELogFile
[hide private]
[frames] | no frames]

Class FMELogFile

object --+
         |
        FMELogFile

init()

Create an instance of a LogFile object

Instance Methods [hide private]
 
__init__()
x.__init__(...) initializes x; see help(type(x)) for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
None
activityMessage(message)
Provide an activity feedback message to command line users.
None
allowDuplicateMessages(allowDuplicateMessages)
This routine sets the allow duplicate messages status of the logfile.
bool
getAllowDuplicateMessages()
This routine gets the allow duplicate messages status of the logfile.
string
getFileName()
Get the name of the file that is currently being used to log messages.
bool
getHeldMessages()
Retrieve any held messages and clear the held messages buffer.
 
getMessage(messageNumber, messageParameters)
This method returns the message mapped from messageNumber in FME_HOME/messages/fmemessages.fms.
bool
getSilent()
Get the 'silent' status of the logfile.
None
holdMessages(holdMessages)
Inform FME whether or not log messages should be held.
None
logException(exception, severity)
Log an exception to the logfile.
None
logFeature(feature, severity, maxCoords)
Log a feature to the logfile.
None
logMessage(messageNumber, parameters, severity)
Log a message to the log file.
None
logMessageString(message, severity)
Log a simple string to the log file.
int
numFeaturesLogged()
Return the total number of features logged.
None
setCallBack(function)
Provide FME with a callback function that will be called whenever a message is logged.
None
setFileName(fileName, append)
Set the name of the file that is currently being used to log messages.
None
silent(silent)
Set the 'silent' status of the logfile.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__()
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

activityMessage(message)

 

Provide an activity feedback message to command line users. Use this message to output any kind of dots or numbers that should be sent to standard output when NOT logging to standard output. Use this function in place of printing to standard output directly. To enable this functionality, the session object must be initialized with the LOG_ENABLE_STDOUT directive set to 'yes'

Parameters:
  • message (string) - The feedback message to provide to users.
Returns: None

allowDuplicateMessages(allowDuplicateMessages)

 

This routine sets the allow duplicate messages status of the logfile. If in duplicate message mode subsequent messages with the same text are logged, otherwise only the first message is logged and the duplicates are counted and a count is logged as the next line instead once a different message is logged. Default is False.

Parameters:
  • allowDuplicateMessages (bool) - When True, duplicate messages are not hidden in the log. Otherwise if False, log hiding of duplicate messages is enabled.
Returns: None

getAllowDuplicateMessages()

 

This routine gets the allow duplicate messages status of the logfile. If in duplicate message mode subsequent messages with the same text are logged, otherwise only the first message is logged and the duplicates are counted and a count is logged as the next line instead once a different message is logged. Default is False.

Returns: bool

getMessage(messageNumber, messageParameters)

 

This method returns the message mapped from messageNumber in FME_HOME/messages/fmemessages.fms. The mapped message has all its %s replaced by the value in messageParameters indexed at s, where s is an integer >= 0.

Parameters:
  • messageNumber (int) - The index of the message in FME's 'messages' location.
  • messageParameters (list of strings) - The values used to replace the %s patterns in the returned message, where s is an integer >= 0.
Returns:
The mapped message with %s patterns replaced.
Raises:
  • FMEException - An exception is raised if a message is not successfully retrieved.

holdMessages(holdMessages)

 

Inform FME whether or not log messages should be held. If set to True, then any log messages will be stored in an internal memory buffer for later retrieval, and no messages will be written to the log file, or sent to the callback.

Held messages are retained until they are retrieved with getHeldMessages, even if holdMessages is set to False.

Parameters:
  • holdMessages (bool) - If set to True, then any log messages will be stored in an internal memory buffer for later retrieval, and no messages will be written to the log file, or sent to the callback.
Returns: None

logException(exception, severity)

 

Log an exception to the logfile.

Parameters:
Returns: None

logFeature(feature, severity, maxCoords)

 

Log a feature to the logfile.

Parameters:
Returns: None

logMessage(messageNumber, parameters, severity)

 

Log a message to the log file.

Parameters:
  • messageNumber (int) - This is the message index, which is stored in a file in FME's 'messages' directory.
  • parameters (list of strings) - Supply the values for the fill-in parameters (0, 1, 2, ...) of the message.
  • severity (int) - (Optional) The message level. Default value is FME_INFORM.

    Must be one of FME_INFORM, FME_WARN, FME_ERROR, FME_FATAL, FME_STATISTIC, or FME_STATUSREPORT

Returns: None

logMessageString(message, severity)

 

Log a simple string to the log file.

Parameters:
Returns: None

setCallBack(function)

 

Provide FME with a callback function that will be called whenever a message is logged. By default, messages will be logged to both the callback function and the Log file. If setFileName is called with None as the filename parameter, then messages will only be sent to the callback.

The callback function must take two arguments: An int severity, and a string message.

Parameters:
  • function (Callable) - The function to provide FME for use as a callback function.
Returns: None

setFileName(fileName, append)

 

Set the name of the file that is currently being used to log messages.

If the filename is different from the current file, then the current file is closed, and the new one is opened.

Parameters:
  • fileName (string) - The file name to set.
  • append (bool) - Append new messages to the file if True. Clear the file before any new log messages are added if False
Returns: None
Raises:
  • FMEException - An exception is raised if there was a problem

silent(silent)

 

Set the 'silent' status of the logfile. When in 'silent' mode, nothing is logged.

Parameters:
  • silent (bool) - When True, 'silent' mode is enabled and nothing is logged. Otherwise if False, logging is enabled.
Returns: None