StreamHandler.emit() writes formatted output to a Writable stream. ConsoleHandler maps log levels to console.warn/error/log. StderrHandler emits via console.error. handleError() logs diagnostics instead of throwing. FileHandler throws NotImplementedError on construction. Removed Node.js stream import and conditional require() block. |
||
|---|---|---|
| docs | ||
| scripts | ||
| src | ||
| tests/unit | ||
| vendor | ||
| .gitignore | ||
| .gitmodules | ||
| bitbucket-pipelines.yml | ||
| configure | ||
| configure.ac | ||
| CONTRIBUTING.md | ||
| eslint.config.mjs | ||
| jest.config.mjs | ||
| LICENSE | ||
| Makefile | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| TODO | ||
| tsconfig.debug.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| typedoc.json | ||
esm-logging
This README is a stub. Working on it. Currently stabilizing the build environment after that I'll make it nice around here.
A quasi-port of the Python standard library logging module to ECMAScript.
Why?
First of, because logging is important. It is important for debugging purposes, leading to faster and more resilient development, for traceability leading to better security. Most logging libraries I've discovered didn't satisfy me, introduced weird concepts and all in all just weren't great. Other programming language ecosystems offer way nicer logging facilities. Take Rust for example, or... Python! Python has PEP, giving it a very structured approach towards implementing new features and that's also how its logging facilities came to be (PEP 282). Python's logging facilities are implemented by the logging module, which is part of the standard library and has been since 2002. It was originally authored by Vinay Sajip
Roadmap
- do a quasi-port of the logging module with minimal amount of adaption
- add documentation
- add support for asynchronous calls
- implement Open Cybersecurity Framework (OCSF) formatter
- implement (Browser) local storage handler as a replacement for file handler
Usage
For the time being, please check out my CI service, for an idea on how to build this.