1
0
mirror of https://git.stamm.me/OpenServer/NodeLogging.git synced 2024-11-24 10:19:24 +00:00

Modifying readme.md for new structure

This commit is contained in:
Fabian 2019-03-31 23:54:23 -04:00
parent 72f06a88d6
commit 03cc58d3e1
2 changed files with 9 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@hibas123/nodelogging", "name": "@hibas123/nodelogging",
"version": "1.6.0-alpha.1", "version": "1.6.0-alpha.2",
"description": "", "description": "",
"main": "out/index.js", "main": "out/index.js",
"types": "out/index.d.ts", "types": "out/index.d.ts",

View File

@ -1,4 +1,8 @@
Simple logging module, that supports terminal coloring and writing to files Simple logging module, that supports terminal coloring and writing to files.
This module build ontop of [@hibas123/logging](https://www.npmjs.com/package/@hibas123/utils).
It extends the default behavior to support Logging to Files out of the Box.
# Getting Started # Getting Started
@ -27,10 +31,10 @@ All Logging types except the simple error take as many arguments as you want. Th
NodeLogging can work without any configuration, but it may be useful to change the log output folder. NodeLogging can work without any configuration, but it may be useful to change the log output folder.
Todo so you are capable of creating own instances of the LoggingBase class Todo so you are capable of creating own instances of the LoggingExtended class
``` javascript ``` javascript
const CustomLogging = new LoggingBase(name | { const CustomLogging = new LoggingExtended(name | {
name: "custom", // default undefined name: "custom", // default undefined
files: true | false | { //default true files: true | false | { //default true
logfile: "./logs/test.log", logfile: "./logs/test.log",
@ -52,7 +56,7 @@ To not use any logfiles just set files to false.
There is a new Plugin API available, that makes is possible to add custom Logging Adapter. There is a new Plugin API available, that makes is possible to add custom Logging Adapter.
``` javascript ``` javascript
const Demo = new LoggingBase("Demo"); const Demo = new LoggingExtended("Demo");
Demo.addAdapter(new DemoAdapter({ color: "rainbow" })); Demo.addAdapter(new DemoAdapter({ color: "rainbow" }));
``` ```