How to use the batch-cluster.Logger.filterLevels function in batch-cluster

To help you get started, we’ve selected a few batch-cluster 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 photostructure / exiftool-vendored.js / src / _chai.spec.ts View on Github external
import * as fse from "fs-extra"
import { tmpdir } from "os"
import { join } from "path"
import { env } from "process"

import { orElse } from "./Maybe"

const chai = require("chai")
chai.use(require("chai-as-promised"))
chai.use(require("chai-subset"))

// Tests should be quiet unless LOG is set
setLogger(
  Logger.withLevels(
    Logger.withTimestamps(
      Logger.filterLevels(
        {
          trace: console.log,
          debug: console.log,
          info: console.log,
          warn: console.warn,
          error: console.error
        },
        orElse(env.LOG as any, "error")
      )
    )
  )
)

export { expect } from "chai"

export const testDir = join(__dirname, "..", "test")
github photostructure / exiftool-vendored.js / src / update / mktags.ts View on Github external
taskRetries: 3,
  streamFlushMillis: 1,
  minDelayBetweenSpawnMillis: 0
})

function ellipsize(str: string, max: number) {
  str = "" + str
  return str.length < max ? str : str.substring(0, max - 1) + "…"
}

// NO SRSLY STOP SCROLLING IT REALLY IS BAD

setLogger(
  Logger.withLevels(
    Logger.withTimestamps(
      Logger.filterLevels(
        {
          trace: console.log,
          debug: console.log,
          info: console.log,
          warn: console.warn,
          error: console.error
        },
        orElse(env.LOG as any, "info")
      )
    )
  )
)

on("uncaughtException", (error: any) => {
  console.error("Ack, caught uncaughtException: " + error.stack)
})
github photostructure / exiftool-vendored.js / src / _chai.spec.ts View on Github external
import * as fse from "fs-extra"
import { tmpdir } from "os"
import { join } from "path"
import { env } from "process"

import { orElse } from "./Maybe"

const chai = require("chai")
chai.use(require("chai-as-promised"))
chai.use(require("chai-arrays"))

// Tests should be quiet unless LOG is set
setLogger(
  Logger.withLevels(
    Logger.withTimestamps(
      Logger.filterLevels(
        {
          trace: console.log,
          debug: console.log,
          info: console.log,
          warn: console.warn,
          error: console.error
        },
        orElse(env.LOG as any, "error")
      )
    )
  )
)

export { expect } from "chai"

export const testDir = join(__dirname, "..", "test")