How to use caller-callsite - 1 common examples

To help you get started, we’ve selected a few caller-callsite 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 gregtillbrook / react-head-start / src / server / utils / logger.js View on Github external
export default function getLog(context) {
  if(!context){
    const filePath = callerCallsite().getFileName();
    context = path.basename(filePath);
  }  

  const logger = new winston.Logger({
    transports: [

      new (winston.transports.Console)({
        level: config.logging.consoleLogLevel,
        handleExceptions: true,
        json: false,
        colorize: true,
        formatter: (options)=>{
          return formatLogMessage(options, context);
        }
      }),

caller-callsite

Get the callsite of the caller function

MIT
Latest version published 3 years ago

Package Health Score

70 / 100
Full package analysis

Popular caller-callsite functions