Module: alfresco/core/PubSubLog

alfresco/core/PubSubLog

Singleton providing class for publication/subscription logging. The idea is that all pub/sub data is logged through a single object that can be used for rendering logging data. This only happens if DEBUG mode is on.
Author:
  • Dave Draper
License:
Source:

Members

_log

Source:

Methods

addEntry(entry)

Parameters:
Name Type Description
entry object The log entry
Source:

pub(topic, payload, object)

Parameters:
Name Type Description
topic string The topic published to
payload object The published payload (will include the topic)
object object The object that made the subscription
Source:

sub(topic, callback, object)

Parameters:
Name Type Description
topic string The topic subscribed to
callback object The function passed as a callback
object object The object that made the subscription
Source:

unsub(handle, object)

Parameters:
Name Type Description
handle object The supplied subscription handle
object object The object that made the subscription
Source:

updateLog(type, topic, data, object)

This method constructs a log entry using the supplied params and then calls [alfresco/core/PubSubLog#addEntry] It also logs the entry to the browser console to help debugging, if the console is available.
Parameters:
Name Type Description
type string The type of pub/sub event (e.g. publish, subscribe, unsubscribe)
topic string The associated topic (if available)
data object Any associated data with the event (e.g. the publication payload)
object object The widget or service that triggered the event
Source: