How to use the consola.trace function in consola

To help you get started, we’ve selected a few consola examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nuxt-community / nuxt-generate-cluster / lib / utils / message-broker.js View on Github external
handleMessage(message, worker) {
    consola.trace((this.alias || this.id) + ' received message', message instanceof Object ? JSON.stringify(message) : message)

    const { receiverId } = message
    if (receiverId !== undefined) {
      if (
        receiverId === this.id ||
        receiverId === this.alias ||
        (this.isMaster && receiverId === this.masterId)
      ) {
        this.callService(message, worker)
      } else if (this.isMaster && this.proxies[receiverId]) {
        this.proxies[receiverId].send(message)
      } else {
        consola.warn(`Proxy ${receiverId} not registered`)
      }
    }
  }
github nuxt-community / nuxt-generate-cluster / lib / utils / message-broker.js View on Github external
sendMessage(message) {
    if (!this.isMaster && !cluster.isMaster) {
      consola.trace(`sending message through process`, JSON.stringify(message))

      process.send(message)
    } else if (!this.isMaster && this.masterRef) {
      return new Promise((resolve) => {
        consola.trace(`sending message through promise`, JSON.stringify(message))

        const ref = {}
        if (message.serviceId === '_register') {
          ref.send = (message) => {
            this.handleMessage(message)
          }
        }

        this.masterRef.handleMessage(message, ref)
        resolve()
      })
github nuxt-community / nuxt-generate-cluster / lib / utils / message-broker.js View on Github external
return new Promise((resolve) => {
        consola.trace(`sending message through promise`, JSON.stringify(message))

        const ref = {}
        if (message.serviceId === '_register') {
          ref.send = (message) => {
            this.handleMessage(message)
          }
        }

        this.masterRef.handleMessage(message, ref)
        resolve()
      })
    } else if (this.proxies[message.receiverId]) {