How to use the caterpillar.Transform function in caterpillar

To help you get started, we’ve selected a few caterpillar examples, based on popular ways it is used in public projects.

github nfriedly / nfriedly.com / node_modules / docpad / node_modules / caterpillar-human / out / lib / caterpillar-human.js View on Github external
seperator = '\n    ';
          debugString = "→ [" + entry.timestamp + "] [" + entry.file + ":" + entry.line + "] [" + entry.method + "]";
          if (debugFormatter) {
            debugString = debugFormatter(debugString);
          }
          result = "" + messageString + seperator + debugString + "\n";
        } else {
          result = messageString + '\n';
        }
      }
      return result;
    };

    return Human;

  })(require('caterpillar').Transform);

  module.exports = {
    Human: Human,
    createHuman: function() {
      var args;
      args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
      return (function(func, args, ctor) {
        ctor.prototype = func.prototype;
        var child = new ctor, result = func.apply(child, args);
        return Object(result) === result ? result : child;
      })(Human, args, function(){});
    }
  };

}).call(this);
github nfriedly / nfriedly.com / node_modules / docpad / node_modules / caterpillar-filter / out / lib / caterpillar-filter.js View on Github external
if (message) {
      message = JSON.stringify(message);
    }
    return next(null, message);
  };

  Filter.prototype.format = function(entry) {
    if (entry.levelNumber > this.config.level) {
      return null;
    }
    return entry;
  };

  return Filter;

})(require('caterpillar').Transform);

module.exports = {
  Filter: Filter,
  createFilter: function() {
    var args;
    args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
    return (function(func, args, ctor) {
      ctor.prototype = func.prototype;
      var child = new ctor, result = func.apply(child, args);
      return Object(result) === result ? result : child;
    })(Filter, args, function(){});
  }
};
github fomantic / Fomantic-UI / node / node_modules / docpad / node_modules / caterpillar-human / out / lib / caterpillar-human.js View on Github external
seperator = '\n    ';
        debugString = "→ [" + entry.timestamp + "] [" + entry.file + ":" + entry.line + "] [" + entry.method + "]";
        if (debugFormatter) {
          debugString = debugFormatter(debugString);
        }
        result = "" + messageString + seperator + debugString + "\n";
      } else {
        result = messageString + '\n';
      }
    }
    return result;
  };

  return Human;

})(require('caterpillar').Transform);

module.exports = {
  Human: Human
};

caterpillar

Caterpillar is the ultimate logging system for Deno, Node.js, and Web Browsers. Log levels are implemented to the RFC standard. Log entries can be filtered and piped to various streams, including coloured output to the terminal, the browser's console, and

MIT
Latest version published 1 year ago

Package Health Score

60 / 100
Full package analysis

Similar packages