How to use the wechaty-puppet.log.silly function in wechaty-puppet

To help you get started, we’ve selected a few wechaty-puppet 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 wechaty / wechaty-puppet-padplus / src / server-manager / mongo-manager.ts View on Github external
public async init (mongoUrl: string) {
    log.silly(PRE, `Mongo init()`)

    await mongoose.connect(mongoUrl, {
      server: { poolSize: 30 },
      useNewUrlParser: true,
    })

    this.db = mongoose.connection
    this.db.on('error', () => log.error('connection error'))
    this.db.once('open', () => {
      log.info(`Connected successfully!`)
    })
  }
github wechaty / wechaty-puppet-padplus / src / server-manager / mongo-manager.ts View on Github external
public async release () {
    log.silly(PRE, `Close mongo connection`)
    if (!this.db) {
      throw new Error(`mongoose connection has not init.`)
    }
    await this.db.close()
  }