The module in JavaScript provides convenient, layered, logging to the server.


Keywords
wTools, logger, logging, log, colorful log, multilevel log, colors, color
License
MIT
Install
npm install wloggertoserver@0.3.68

Documentation

module::LoggerToServer status experimental

Class to redirect output from remote source to console.

Installation

npm install wloggertoserver

Usage

Options

  • url { string }[ optional, default : localhost:3000 ] - address of the server.

Methods

  • connect - connect to server;
  • disconnect - disconnect from current server.

More information about common wLogger you may find here.

Example
/* Assume that we have local socket.io server on port 3000 */

/* create logger and pass connection address as option */
var l = new wLoggerToServer({ url : 'http://127.0.0.1:3000' });
l.connect()
/* connect returns consequence that gives us a message on successful connection */
.doThen( function ()
{
  /* logger is connected, now send a message */
  l.log( 'Message to server' );
  l.disconnect();
})