All Projects → epegzz → winston-dev-console

epegzz / winston-dev-console

Licence: MIT license
Winston@3 console format aimed to improve development UX

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to winston-dev-console

ducky
Chrome extension to overlay a (super adorable) rubber duck, as a virtual companion during rubber duck debugging.
Stars: ✭ 80 (-9.09%)
Mutual labels:  development, debug
Okteto
Develop your applications directly in your Kubernetes Cluster
Stars: ✭ 1,937 (+2101.14%)
Mutual labels:  development, debug
go-getting-started
Develop Go Apps in Kubernetes with Okteto
Stars: ✭ 32 (-63.64%)
Mutual labels:  development, debug
Translatedjs
Internationalization and localization for JavaScript and Node.js
Stars: ✭ 17 (-80.68%)
Mutual labels:  formatter, format
l
Golang Pretty Logger
Stars: ✭ 51 (-42.05%)
Mutual labels:  logger, pretty
Brazilian Utils
Utils library for specific Brazilian businesses
Stars: ✭ 1,023 (+1062.5%)
Mutual labels:  formatter, format
Gdbstub
A simple, dependency-free GDB stub that can be easily dropped in to your project.
Stars: ✭ 56 (-36.36%)
Mutual labels:  development, debug
teks
Easily get custom go template based outputs to your command-line tool. Like in docker/kubernetes
Stars: ✭ 41 (-53.41%)
Mutual labels:  formatter, format
ifto
A simple debugging module for AWS Lambda (λ) timeout
Stars: ✭ 72 (-18.18%)
Mutual labels:  debug, node-js
Laravel Mailable Test
An artisan command to easily test mailables
Stars: ✭ 143 (+62.5%)
Mutual labels:  development, debug
Fmt Obj
Stringifies any javascript object in your console for CLI inspection ✨
Stars: ✭ 428 (+386.36%)
Mutual labels:  formatter, format
debug
A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. Works in Node.js and web browsers
Stars: ✭ 10,554 (+11893.18%)
Mutual labels:  debug, node-js
ddquery
Django Debug Query (ddquery) beautiful colored SQL statements for logging
Stars: ✭ 25 (-71.59%)
Mutual labels:  formatter, debug
Uncrustify
Code beautifier
Stars: ✭ 2,442 (+2675%)
Mutual labels:  formatter, format
pretty-remarkable
Plugin for prettifying markdown with https://github.com/jonschlinkert/remarkable using custom renderer rules.
Stars: ✭ 22 (-75%)
Mutual labels:  formatter, format
Snazzy
Format JavaScript Standard Style as Stylish (i.e. snazzy) output
Stars: ✭ 381 (+332.95%)
Mutual labels:  development, formatter
AutoFormatInputWatcher
This repository contains input watcher for auto formatting digits in edit text
Stars: ✭ 15 (-82.95%)
Mutual labels:  formatter, format
pretty print formatter
Pretty Print Formatter for Elixir Logger module -- Colorize Ecto's SQL ouput 🖌️
Stars: ✭ 22 (-75%)
Mutual labels:  formatter, logger
Xray React
React layout debugger.
Stars: ✭ 128 (+45.45%)
Mutual labels:  development, debug
lit-date
Light-weight, faster datetime formatter for modern browsers.
Stars: ✭ 33 (-62.5%)
Mutual labels:  formatter, format

winston-dev-console

A Winston@3 console format for development (based on winston-console-format) that aims to improve NodeJS development UX by

  • adding the source of the logging statement to the log output
  • optimizing readability of each log statement through log statement separation, output colorization and arg pretty printing

Demo

Real world screenshot:

Install

npm install winston @epegzz/winston-dev-console

or

yarn add winston @epegzz/winston-dev-console

Usage TypeScript

import { createLogger, format, transports } from "winston";
import winstonDevConsole from "@epegzz/winston-dev-console";
import util from "util";

let log = createLogger({
  level: "silly", // or use process.env.LOG_LEVEL
});

// Note: You probably only want to use winstonDevConsole during development
log = winstonDevConsole.init(log);
log.add(
  winstonDevConsole.transport({
    showTimestamps: false,
    addLineSeparation: true,
  })
);

log.silly("Logging initialized");
log.debug("Debug an object", { make: "Ford", model: "Mustang", year: 1969 });
log.verbose("Returned value", { value: util.format });
log.info("Information", {
  options: ["Lorem ipsum", "dolor sit amet"],
  values: ["Donec augue eros, ultrices."],
});
log.warn("Warning");
log.error(new Error("Unexpected error"));

Usage JavaScript

const { createLogger, format, transports } = require("winston");
const winstonDevConsole = require("@epegzz/winston-dev-console").default;
const util = require("util");

let log = createLogger({
  level: "silly", // or use process.env.LOG_LEVEL
});

// Note: You probably only want to use winstonDevConsole during development
log = winstonDevConsole.init(log);
log.add(
  winstonDevConsole.transport({
    showTimestamps: false,
    addLineSeparation: true,
  })
);

log.silly("Logging initialized");
log.debug("Debug an object", { make: "Ford", model: "Mustang", year: 1969 });
log.verbose("Returned value", { value: util.format });
log.info("Information", {
  options: ["Lorem ipsum", "dolor sit amet"],
  values: ["Donec augue eros, ultrices."],
});
log.warn("Warning");
log.error(new Error("Unexpected error"));

API

winstonDevConsole.format(options)

options

Configuration object.

Type: DevConsoleFormatOptions

options.inspectOptions

util.inspect() configuration object.

Type: Object

options.basePath

Used to remove the base path of the project when showing the file path of the log statement. By default anything in the path before (and including) the src folder will be removed.

Type: String

options.addLineSeparation

Wheather or not to separate each log statement with a blank line.

Type: Boolean
Default: true

options.showTimestamps

Wheather or not to show timestamps
During development the timestamps are usually more noise then helpful, therefore disabled by default.

Type: Boolean
Default: false

Acknowledgements

This project is inspired by and partly shamelessly copied from winston-console-format

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].