console~ConsoleManager()

The console manager stores a ring buffer for each instance.

new ConsoleManager()

Methods

afterPropertiesSet()

Initialization after the components in the application context have been constructed.

createConsole(instanceNodeopt, instanceProcessopt) → {Promise.<tree.Node>}

Creates a new console for the given Inexor Core instance.
Parameters:
Name Type Attributes Description
instanceNode tree.Node <optional>
The instance tree node.
instanceProcess process <optional>
The instance process.
Returns:
Promise.<tree.Node> - The console tree node.

getBuffer()

Returns the contents of a ring buffer. Example output: [ { name: 'foo', hostname: '912d2b29', pid: 50346, level: 30, msg: 'hello world', time: '2012-06-19T21:34:19.906Z', v: 0 } ] TODO: use this from REST API. TODO: create a CLI command which prints the last N messages of a specific console. TODO: create a CLI command which tails on a specific console. TODO: create a simple web app which shows

getInstanceLogger()

Returns the logger for the given instance.

mapStreamToLog(data) → {Promise.<bool>}

Redirects stdout / stderr streams to logging.
Parameters:
Name Type Description
data stream The stream data.
Returns:
Promise.<bool>

setDependencies()

Sets the dependencies from the application context.

writeBuffer(instanceId, message, level)

Writes to the console buffer.
Parameters:
Name Type Default Description
instanceId number The instance id.
message string The log message.
level string info The log level.