How to use the bs-logger.LogLevels.debug function in bs-logger

To help you get started, we’ve selected a few bs-logger 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 kulshekhar / ts-jest / src / compiler.ts View on Github external
}

  // Use full language services when the fast option is disabled.
  if (!configs.tsJest.isolatedModules) {
    // Set the file contents into cache.
    const updateMemoryCache = (code: string, fileName: string) => {
      logger.debug({ fileName }, `updateMemoryCache()`)
      if (memoryCache.contents[fileName] !== code) {
        memoryCache.contents[fileName] = code
        memoryCache.versions[fileName] = (memoryCache.versions[fileName] || 0) + 1
      }
    }

    // Create the compiler host for type checking.
    const serviceHostDebugCtx = {
      [LogContexts.logLevel]: LogLevels.debug,
      namespace: 'ts:serviceHost',
      call: null,
    }
    const serviceHostTraceCtx = {
      ...serviceHostDebugCtx,
      [LogContexts.logLevel]: LogLevels.trace,
    }

    const serviceHost = {
      getScriptFileNames: () => Object.keys(memoryCache.versions),
      getScriptVersion: (fileName: string) => {
        const normalizedFileName = normalize(fileName)
        const version = memoryCache.versions[normalizedFileName]

        // We need to return `undefined` and not a string here because TypeScript will use
        // `getScriptVersion` and compare against their own version - which can be `undefined`.
github kulshekhar / ts-jest / src / compiler.spec.ts View on Github external
it('should use the cache', () => {
    const compiled1 = compiler.compile(source, __filename)
    expect(logTarget.filteredLines(LogLevels.debug, Infinity)).toMatchInlineSnapshot(`
Array [
  "[level:20] readThrough(): cache miss
",
  "[level:20] getOutput(): compiling using language service
",
  "[level:20] updateMemoryCache()
",
  "[level:20] visitSourceFileNode(): hoisting
",
  "[level:20] getOutput(): computing diagnostics
",
  "[level:20] readThrough(): writing caches
",
]
`)
github kulshekhar / ts-jest / src / transformers / hoist-jest.ts View on Github external
return (ctx: TransformationContext): Transformer => {
    return logger.wrap(
      { [LogContexts.logLevel]: LogLevels.debug, call: null },
      'visitSourceFileNode(): hoisting',
      (sf: SourceFile) => ts.visitNode(sf, createVisitor(ctx, sf)),
    )
  }
}