# @architelos/node-log-js

> Tiny logging module. Inspired by npm/debug.

Latest version **1.0.1** (published 2022-12-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @architelos/node-log-js
pnpm add @architelos/node-log-js
yarn add @architelos/node-log-js
bun add @architelos/node-log-js
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-12-20 |
| First published | 2022-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | architelos |
| Maintainers | architelos |
| Keywords | logging, debug, log, debugger |

## Links

- npm: https://www.npmjs.com/package/@architelos/node-log-js
- Repository: https://github.com/architelos/node-log-js
- Homepage: https://github.com/architelos/node-log-js#readme
- Issues: https://github.com/architelos/node-log-js/issues
- npm.io page: https://npm.io/package/@architelos/node-log-js

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2022-12-20

## README

## node-log-js

<p align="center">
        <img src="https://i.imgur.com/1bmbtmz.png" /></a><br>
</p>

<p align="center">Tiny logging module. Inspired by npm/debug.</p>

### Contents
  - [Installing](#installing)
  - [Usage](#usage)
  - [Contributing](#contributing)
  - [License](#license)


### Installing
Using `npm`:
```bash
$ npm install @architelos/node-log-js
```

### Usage
- Import `node-log-js`:
```js
import Logger from "@architelos/node-log-js";

// or

const Logger = require("@architelos/node-log-js");
```

- Create a new `Logger` instance:
```js
let logger = new Logger();
```

- Create a new logger:
```js
let logger = logger.Logger("worker", "37", "error");
```

Available parameters:
| Name        | Type   | Description                                                               | Default  |
|-------------|--------|---------------------------------------------------------------------------|----------|
| `loggerName`  | `string` | Name of the logger                                                        | "logger" |
| `loggerColor` | `string` | ANSI color code of<br>the log message                                     | "37"     |
| `loggerLevel` | `string` | Name of the `console`<br>function. For example,<br>`log`, `error`, `warn` | "log"    |

- Use the logger:
```js
logger("Hello! I am some text!");
```

##### Additionally, the environment variable `LOGGER_ALLOW` can be set to a regex (or multiple regexes seperated by a `,`) to allow/disallow loggers from logging.
###### On Windows (cmd):
```bash
$ set LOGGER_ALLOW=""
```

###### On Windows (powershell):
```bash
$ $env:LOGGER_ALLOW=""
```

###### On Linux (bash):
```bash
export LOGGER_ALLOW=""
```

## Contributing
Open a pull request, or submit a new issue.

## License
See `license`.

---
_Source: https://npm.io/package/@architelos/node-log-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
