Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Releases: harrisonhoward/forbidden-node-logger

Improved Typings Support

26 Oct 01:23
Compare
Choose a tag to compare

Includes better typings, will change how you create a new Logger.

const NodeLogger = require("forbidden-node-logger");
cont Logger = new NodeLogger.Logger();
import * as NodeLogger from "forbidden-node-logger";
const Logger = new NodeLogger.Logger();

Log Type Support

06 Oct 03:24
Compare
Choose a tag to compare

With this new version the Log structure now takes a type (none, info, debug, warn or error)
Using Logger.log() will allow you to set the type (not required by any code check will error) Logger.log("error", "Log type is error")
info(), debug(), warn() and error() will set the type
eventLog() has the same change

Setting the type to warn or error will not emit an event only the method variants will. This change was designed for allowing filtering the collection by the type of log.

Note:
Doing Logger.log("this", " is my ", "log") will set the type to "none" and prepend "this" to the log.
This means you are not required to enter a type, if you don't anything you enter automatically gets prepend and type set to none.

Upgraded File Support

05 Oct 07:41
Compare
Choose a tag to compare

Warnings and Errors can their own dedicated file.
dd-warn.log and dd-error.log

More methods for retrieving logs
getLogByDay(day?, month?, year?); Will return an array of lines from the specified log.
getLogsByMonth(month?, year?); Will return an object containing the day and it's log. { '4': ["Lines"], '5': ["Lines"] }
getLogsByYear(year?); Will return an object containing the month and it's days which hold the lines { '9': { '4': ["Lines"], '5': ["Lines"] } }

_prefix: string -> _prefix: LoggerPrefixFunction

04 Oct 07:55
Compare
Choose a tag to compare

Fixe for a missed typed _prefix

Typings Declaration

04 Oct 07:26
Compare
Choose a tag to compare

Added a TypeScript Typings Declaration file for TypeScript users.
Some other changes include:
getCurrentLog() -> getLatestLog()

Support for Errors

02 Oct 23:56
Compare
Choose a tag to compare

With this new release, many formatting and general code fixes were made. This was under the hood stuff and won't change what you see.
However, I have added proper support for errors, this works for the collection and the file history as expected.

Official Release

02 Oct 07:34
Compare
Choose a tag to compare

README.md