Logging

In weave every module provides a logger instance. They a initiated in the broker.

Usage

    const ServiceBroker = require('@weave-js/core')

    const broker = ServiceBroker({
        nodeId: 'node-1',
        loglevel: 'debug',
    })

    broker.createService({
        name: 'test'
        actions: {
            one (context) {
                context.log.debug('Action one of service test called.')
            }
        }
    })

    broker.start()
        .then(() => broker.call('test.one'))
        .then(() => broker.log.debug('Node started!'))

Console output

    [2018-09-01T10:55:56.751Z] DEBUG       node-1/TEST: Action one of service test called.