https://github.com/wolframresearch/loggers-js
https://github.com/wolframresearch/loggers-js
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/wolframresearch/loggers-js
- Owner: WolframResearch
- License: mit
- Created: 2021-10-11T18:24:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-12T23:27:36.000Z (over 4 years ago)
- Last Synced: 2025-03-28T17:49:31.936Z (10 months ago)
- Language: TypeScript
- Size: 18.6 KB
- Stars: 2
- Watchers: 18
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Logger.js
Just another simple JavaScript logging framework.
Supports different named loggers (which can be enabled or disabled individually) and different logging levels.
Loggers can be configured through a global variable `LOGGERS`, through a URL query parameter `?loggers={name}={loglevel}`, or programmaticaly.
## Installation
Assuming you are using a package manager such as [npm](https://www.npmjs.com/get-npm) or [Yarn](https://yarnpkg.com/en/), just install this package from the npm repository:
npm install loggers-js
Then you can import `getLogger` in your JavaScript code:
import {getLogger} from 'loggers-js';
## Example
const logger = getLogger('mylogger');
logger.enable();
logger.setLevel('info');
logger.info('Hello world!');
## Contributing
Everyone is welcome to contribute. Please read the [Contributing agreement](CONTRIBUTING.md) and the [Development guide](./docs/Development.md) for more information, including how to run the tests.
## Versioning
We use [semantic versioning](https://semver.org/) for this library and its API.
See the [changelog](CHANGELOG.md) for details about the changes in each release.