Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crawler-ninja-logger

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crawler-ninja-logger - npm Package Compare versions

Comparing version 1.0.0 to 1.0.2

33

index.js
var fs = require("fs")
var bunyan = require("bunyan");
/**
* Common method to log used by the crawler and if needed by plugins
* Ideally, the log json structure should contains the following attributes :
* - url (can be null for specific crawl steps).
* - step
* - message
* - options
*
*/
var infoFile = process.cwd() + "/logs/crawler.log";
var debugFile = process.cwd() + "/logs/debug.log";
var logFolder = process.cwd() + "/logs" ;
if (! fs.existsSync(logFolder)) {
fs.mkdirSync(logFolder);
}
var infoFile = logFolder + "/crawler.log";
var debugFile = logFolder + "/logs/debug.log";
console.log("Use info log in : " + infoFile);
console.log("Use debug log in : " + debugFile);
/**
* Default logger
*
*/
var Logger = bunyan.createLogger({

@@ -30,3 +50,10 @@ name: 'full-log',

/**
* If needed, a plugin can create a specific log
*
*
* @param the name of the Logger
* @param the json config structure (see bunyan documemntion )
* @return the new logger
*/
var createLogger = function(name, streamInfo) {

@@ -33,0 +60,0 @@ return bunyan.createLogger({

2

package.json
{
"name": "crawler-ninja-logger",
"version": "1.0.0",
"version": "1.0.2",
"description": "Common log method for all crawler.ninja plugins",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc