# betterlogger.js

> Better Logging in NodeJS and Websites ( Browser Console ) This is a better logger for nodejs and web applications

Latest version **1.0.2** (published 2022-02-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install betterlogger.js
pnpm add betterlogger.js
yarn add betterlogger.js
bun add betterlogger.js
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-02-13 |
| First published | 2022-02-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 58 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | LuciferMorningstarDev |
| Maintainers | lucifer-morningstar |
| Keywords | logging, logger, log, log4js, logger4js, nodejs-logger, node-logger, node-logging, web-logger |

## Links

- npm: https://www.npmjs.com/package/betterlogger.js
- Repository: https://github.com/LuciferMorningstarDev/betterlogger.js
- Homepage: https://github.com/LuciferMorningstarDev/betterlogger.js#readme
- Issues: https://github.com/LuciferMorningstarDev/betterlogger.js/issues
- npm.io page: https://npm.io/package/betterlogger.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.2 (latest) — 2022-02-13
- 1.0.1 — 2022-02-13
- 1.0.0 — 2022-02-11

## README

# BetterLogger.js

---

### Better Logging in NodeJS and Websites ( Browser Console )

#### This is a better logger for nodejs and web applications

---

### Import BetterLogger.JS

#### NodeJS

Install module: `npm install betterlogger.js`

```js
var { StaticLogger, Logger } = require('betterlogger.js');

var logger = new Logger('Main', 'main').setDebugging(99);

logger.info('info');
logger.log('log');
logger.notice('notice');
logger.debug('debug');
logger.alert('alert');
logger.warning('warning');
logger.request('request');
logger.debugExtensive('debugExtensive');
logger.logError(new Error('Kakamalaka'));
logger.out('out', 'out');

StaticLogger.setDebugging(99);
StaticLogger.info('info');
StaticLogger.log('log');
StaticLogger.notice('notice');
StaticLogger.debug('debug');
StaticLogger.alert('alert');
StaticLogger.warning('warning');
StaticLogger.request('request');
StaticLogger.debugExtensive('debugExtensive');
StaticLogger.logError(new Error('Kakamalaka'));
StaticLogger.out('out', 'out');
```

#### Plain html import and usage

```html
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>

        <!-- Import Logger -->
        <script src="https://unpkg.com/betterlogger.js@latest/dist/logger.js"></script>
    </head>
    <body>
        <!-- Use Logger -->
        <script>
            var logger = new Logger('Main', 'main').setDebugging(99);

            logger.info('info');
            logger.log('log');
            logger.notice('notice');
            logger.debug('debug');
            logger.alert('alert');
            logger.warning('warning');
            logger.request('request');
            logger.debugExtensive('debugExtensive');
            logger.logError(new Error('Kakamalaka'));
            logger.out('out', 'out');

            StaticLogger.setDebugging(99);
            StaticLogger.info('info');
            StaticLogger.log('log');
            StaticLogger.notice('notice');
            StaticLogger.debug('debug');
            StaticLogger.alert('alert');
            StaticLogger.warning('warning');
            StaticLogger.request('request');
            StaticLogger.debugExtensive('debugExtensive');
            StaticLogger.logError(new Error('Kakamalaka'));
            StaticLogger.out('out', 'out');
        </script>
    </body>
</html>
```

#### React / Other Modular scripts

Install module or load from cdn: `npm install betterlogger.js`

Usage:

```html
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <script type="module">
            import { Logger, StaticLogger } from 'node_modules/betterlogger.js/src/web-logger.js';
            // or
            import { Logger, StaticLogger } from 'betterlogger.js';
            // depends on how your imports gets managed...

            var logger = new Logger('Main', 'main').setDebugging(99);

            logger.info('info');
            logger.log('log');
            logger.notice('notice');
            logger.debug('debug');
            logger.alert('alert');
            logger.warning('warning');
            logger.request('request');
            logger.debugExtensive('debugExtensive');
            logger.logError(new Error('Kakamalaka'));
            logger.out('out', 'out');

            StaticLogger.setDebugging(99);
            StaticLogger.info('info');
            StaticLogger.log('log');
            StaticLogger.notice('notice');
            StaticLogger.debug('debug');
            StaticLogger.alert('alert');
            StaticLogger.warning('warning');
            StaticLogger.request('request');
            StaticLogger.debugExtensive('debugExtensive');
            StaticLogger.logError(new Error('Kakamalaka'));
            StaticLogger.out('out', 'out');
        </script>
    </body>
</html>
```

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