1.1.6 • Published 2 months ago

@jitesoft/yolog-json-plugin v1.1.6

Weekly downloads
2
License
MIT
Repository
github
Last release
2 months ago

Yolog JSON Plugin

npm (scoped) Known Vulnerabilities pipeline status coverage report npm Back project

Plugin for the @jitesoft/yolog logger create logs in json format.
When running in the browser, all the data will be printed to the console, while, when using the nodejs version the data can either be pushed to a file or to the stdout/stderr of the application.

Usage:

Install with your favorite package manager!

npm i @jitesoft/yolog-json-plugin --save
yarn add @jitesoft/yolog-json-plugin

Import and use just as with any other yolog plugin!

import logger from '@jitesoft/yolog';
import JsonPlugin from '@jitesoft/yolog-json-plugin';
logger.addPlugin(new JsonPlugin('file.txt'));

To import it in a browser environment, the src/browser (or /dist/browser for precompiled) suffix have to be added:

import logger from '@jitesoft/yolog';
import JsonPlugin from '@jitesoft/yolog-json-plugin/src/browser';
logger.addPlugin(new JsonPlugin()); // No file!

Data format

Each line in the output is a single JS Object notation, that is, the full file is not an array of json objects, but each line should be parsed as its own.

Example:

{"tag": "emergency", "timestamp": 123123123, "message": "abc123!!", "error":  { "message": "error message!", "stack": [ "callstack here." ] }}
{"tag": "warning", "timestamp": 123123124, "message": "abc123"}

That means that when parsing the file (or output), each line should be parsed as its own object.

1.1.6

2 months ago

1.1.5

4 months ago

1.1.4

7 months ago

1.1.3

9 months ago

1.1.2

10 months ago

1.1.1

12 months ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.11

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.10

2 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago