npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

xlblogger

v1.0.5

Published

logger, basic and simple node logger with console coloration

Downloads

23

Readme

XLBlogger

Basic and simple node.js logger with #ConsoleColoration

Why

I wrote xlblogger because i needed a simple way to follow the execution and debug my nodejs scripts.

Installation

npm install xlblogger

Example


var xlblogger = require('xlblogger');
var logger = new xlblogger('Alpha','C:/XLBlogger');

logger.logValColor('XLBlogger'); // Default Coloration

var FgMagenta = '\x1b[35m'; // Magenta font color Code
logger.logValColor('XLBlogger',FgMagenta);

logger.logThis('Simple string, no console coloration !');
logger.logTree('One','Two','Three');

logger.logBlank();
logger.logAttrVal('Name','Marou');

// output Objects
var data = {}
data.id = 21220244
data.value = 22772020
data.name = 'Marou'
data.pwd = '*******'
data.email = '[email protected]'

logger.output(data)

PS: All the proposed functions works with strings as well as objects.

enter image description here

Features

First thing's first:

var xlblogger = require('xlblogger');

❁ Easy and simple configuration:

• Specify the output directories:

The parent dir is optional :

  • You can specify it globally in 'logConfig.xml' , in this case every instance of xlblogger will have a subdirectory in the specified parent dir.
  • You can keep the default value (C:/XLBlogger)

NOTE : (the xml file is generated after the first execution, in the same folder of your js file)


/* var logger = new xlblogger( [outputDir] , <parentDir> ) */
var logger = new xlblogger('Alpha','C:/XLBlogger');
// or
var logger = new xlblogger('Alpha'); // Default parent dir
XLBlogger
│
└───Alpha
    │   Alpha.[04].Of.16h51.[03].log
    │   Alpha.[04].Of.16h59.[53].log

• Start logging: Time for you to go.

logger.startLog(); // The logger is active by default

• Stop logging: The goal of the "Stop" instruction is to provide the option of disabling the logger without commenting or deleting our messages.

logger.stopLog();

❤ Foreground and Background console colors:

Save attribute : value in the log file and show the message in the console.

logger.logAttrVal('Name','Marou');

Save an empty line, help you improve the readability of your logs.

logger.logBlank();

Save the message and show it in the console with an optional color.

logger.logValColor('Open Source');

var FgMagenta = '\x1b[35m';
logger.logValColor('Open Source',FgMagenta);

Save the message and show it in the console.

logger.logThis('Simple string, no console coloration !');

Save three value and show them in the console with different colors.

logger.logTree('1','2','3');

This feature was added to offer a simple way to export Brut data to a file


var xlblogger = require('xlblogger');

var out = new xlblogger('testOut','C:/XLBlogger');

out.output('Information');

enter image description here

Color code examples:


/*  ColorList  */
      /* ################################# */
           Reset = "\x1b[0m"
           Bright = "\x1b[1m"
           Dim = "\x1b[2m"
           Underscore = "\x1b[4m"
           Blink = "\x1b[5m"
           Reverse = "\x1b[7m"
           Hidden = "\x1b[8m"

           FgBlack = "\x1b[30m"
           FgRed = "\x1b[31m"
           FgGreen = "\x1b[32m"
           FgYellow = "\x1b[33m"
           FgBlue = "\x1b[34m"
           FgMagenta = "\x1b[35m"
           FgCyan = "\x1b[36m"
           FgWhite = "\x1b[37m"

           BgBlack = "\x1b[40m"
           BgRed = "\x1b[41m"
           BgGreen = "\x1b[42m"
           BgYellow = "\x1b[43m"
           BgBlue = "\x1b[44m"
           BgMagenta = "\x1b[45m"
           BgCyan = "\x1b[46m"
           BgWhite = "\x1b[47m"
      /* ################################# */

Screenshots

❤ Foreground and Background console colors:

enter image description here

ϟ Log every execution separately:

enter image description here

License

(The MIT License)