npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sh.log-client

v2.10.4

Published

A generic node.js client to log messages cross-platform. Its complement, 'LogCentral', is a .Net-based server that offers various transport mechanisms and collects messages from arbitrary many clients.

Downloads

9

Readme

LogClient

LogClient (or: log-client) is a universal module for nodejs or JavaScript applications in general for distributed logging using various transport methods. The concept of this logger is based on Microsoft.Extensions.Logging.

Install via npm Current Version

npm install sh.log-client

Included Loggers

Currently, this client includes the following loggers:

  • BaseLogger<T> the abstract base-class for all loggers that includes neccessary functionality, only having its log()-method abstract.
    • BaseScope<T> the base-class for scopes
  • ColoredConsoleLogger<T> a logger that outputs to the console's streams (info, warning, error) and is configurable w.r.t. to which level should be logged to which stream. Also supports colors.
  • DevNullLogger<T> a dummy logger that discards all messages and is always enabled
  • InMemoryLogger<T> and InMemoryLogMessage<T> a logger and its message to store log messages in memory. Supports specifying a maximum capacity so that only the newest messages are kept.
  • DualLogger<T, TLog1, TLog2> a logger that forwards all logging-calls to two other loggers without modifying them.
  • WrappedLogger<TLog1, TLog2> a logger that wraps and mimics an original logger (TLog1) and also forwards any logging calls to a 2nd copy-logger (TLog2). This is an extension to the DualLogger.
  • StreamLogger<T> a logger that writes messages to a Writable-stream. Supports different streams per log level.

Included Extras

Currently, these extras are included:

  • LoggerPipe is a Writable stream that encapsulates any of the above loggers and writes (pipes) all chunks to its log-method. This class is useful when a stream shall be piped to a logger (e.g. when having a logger for each of a process' streams).

Write and contribute your own Loggers

Writing an own logger is as simple as extending BaseLogger<T>. Please, submit a pull-request if you want to contribute your own logger to this repository.

Breaking changes since version 2.0.0

The log-client is supposed to be a functionally equivalent implementation of the logging functionalities found in util-dotnet (https://github.com/MrShoenel/util-dotnet). The concept of Transporters has been removed entirely.