Skip to content

hexcreator/XOUT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crreator Node Version

XOUT

XOUT is a basic, early-version logger that includes caller context information to help lightweight debug TypeScript programs. Currently, it can:

  • Print time locale
  • Use coloring
  • Identify file, function, and line of the caller
  • Set log status types (default, warn, error, debug, success, and baking)
  • Log specific statuses to files for further review It also includes some other utilities.

Installation

To install, run:

npm i xout

Import

import { log, olog, toJSON, inf, demo } from 'xout';

Usage

Log

This is the default function.

log('Default log.');
log('Warn log.', STATUS.WARN);
log('Error log.', STATUS.ERROR);
log('Debug log.', STATUS.DEBUG);
log('Baking log.', STATUS.BAKING);
log('Done log.', STATUS.DONE);
log('Tabbed log.', null, true);
log('Headless log.', null, false, true);

Log


Olog

Stands for "Object Logger", which recursively prints every key and their respective associated value for an inputted object.

let sampl = { name: 'hexcreator', thoughts_on_reader: 'they rock', nested: { child_name: 'none', child_gender: 'none' }  };
olog('OLOG', sampl);

Olog


Others

The other available functions are:

  1. toJSON: converts an input to a JSON string.
  2. types: dumps all property types in non-recursive manner for an object.
  3. inf: prints an in-function progress line which is always tabbed.

Future Work

The config system could be better and more refined, as well as just a lot more tools that can be added. log can also be cleaned up a bit.