ftrack_connect_pipeline.log

class ftrack_connect_pipeline.log.ResultEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: JSONEncoder

JSON encoder for handling non serializable objects in plugin result

default(obj)[source]

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return JSONEncoder.default(self, o)
class ftrack_connect_pipeline.log.LogDB(host_id, db_name=None, table_name=None)[source]

Bases: object

Log database class

database_expire_grace_s = 604800
__init__(host_id, db_name=None, table_name=None)[source]

Initializes a new persistent local log database having database name db_name on disk and table_name table name.

db_name = 'pipeline-{}.db'
table_name = 'LOGMGR'
property connection
get_database_path(host_id)[source]

Get local persistent pipeline database path.

Will create the directory (recursively) if it does not exist.

Raise if the directory can not be created.

add_log_item(log_item)[source]

Stores a LogItem in persistent log database.

get_log_items(host_id)[source]

Stores a LogItem in persistent log database.

get_log_items_by_plugin_id(host_id, plugin_id)[source]

Stores a LogItem in persistent log database.

ftrack_connect_pipeline.log.log_item

class ftrack_connect_pipeline.log.log_item.LogItem(log_result)[source]

Bases: object

Represents a Logging Item Base Class

__init__(log_result)[source]

Initialise LogItem with log_result

log_result: Dictionary with log information.

property execution_time

Return the duration of the log entry.