async function query (opts = {}) {
  return new Promise((resolve, reject) => {
    opts.limit = opts.limit || 100
    var readFn = opts.sort === 'desc' ? fsReverse : fs.createReadStream
    var readStream = readFn(getLogPath(opts.logFile || 0), {encoding: 'utf8'})
    const nosplit = (readFn === fsReverse) // fs-reverse splits for us
    pump(
      readPipeline(readStream, opts, nosplit),
      concat({encoding: 'object'}, res => resolve(/** @type any */(res))),
      reject
    )
  })
}
Query a slice of the log.
@param {LogQueryOpts} [opts]
@returns {Promise<Object[]>}