How to use the actionhero.api.log function in actionhero

To help you get started, we’ve selected a few actionhero 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 zeit / next.js / examples / custom-server-actionhero / initializers / next.js View on Github external
async initialize() {
    api.next = {
      render: async connection => {
        if (connection.type !== 'web') {
          throw new Error('Connections for NEXT apps must be of type "web"')
        }
        const req = connection.rawConnection.req
        const res = connection.rawConnection.res
        return api.next.handle(req, res)
      },
    }

    api.next.dev = api.env === 'development'
    if (api.next.dev) {
      api.log('Running next in development mode...')
    }

    api.next.app = next({ dev: api.next.dev })
    api.next.handle = api.next.app.getRequestHandler()
    await api.next.app.prepare()
  }
github actionhero / actionhero-tutorial / tasks / stats.js View on Github external
async run () {
    const users = await api.users.list()
    const posts = await api.users.postsList()
    api.log('*** STATUS ***', 'info', { users: users.length, posts: posts.length })
  }
}