Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* @type {string}
*
* @example
* console.log('Error was raised on ' + server.nodeId)
*/
this.nodeId = `server:${ this.options.id || nanoid(8) }`
this.options.root = this.options.root || process.cwd()
let store = this.options.store || new MemoryStore()
let log
if (this.options.time) {
log = this.options.time.nextLog({ store, nodeId: this.nodeId })
} else {
log = new Log({ store, nodeId: this.nodeId })
}
/**
* Server actions log.
* @type {Log}
*
* @example
* server.log.each(finder)
*/
this.log = log
this.on('preadd', (action, meta) => {
let isLogux = action.type.slice(0, 6) === 'logux/'
if (!meta.server) {
meta.server = this.nodeId
}
if (!meta.status && !isLogux) {