All files / proxy/utils log.ts

85.71% Statements 6/7
33.33% Branches 1/3
100% Functions 2/2
83.33% Lines 5/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  7x           7x 30x 30x     267x    
import { CloudFrontRequest } from 'aws-lambda'
import { getHeaderValue } from './headers'
 
/**
 * This function depends on 'fpjs_debug' boolean value, determining whether debug logs are going to be logged or not.
 * @param request {CloudFrontRequest}
 */
export function setLogLevel(request?: CloudFrontRequest) {
  const debugValue = request ? getHeaderValue(request, 'fpjs_debug') : undefined
  Iif (debugValue === 'true') {
    return
  }
  console.debug = () => null
}