# js-console-ogging

> A wrapper around console (debug, info, etc.) to have control of log levels.

Latest version **0.1.0** (published 2017-10-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install js-console-ogging
pnpm add js-console-ogging
yarn add js-console-ogging
bun add js-console-ogging
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2017-10-15 |
| First published | 2017-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kay-Uwe |
| Maintainers | klorenz |
| Keywords | console, log, wrapper, logger, logging |

## Links

- npm: https://www.npmjs.com/package/js-console-ogging
- npm.io page: https://npm.io/package/js-console-ogging

## 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

- 0.1.0 (latest) — 2017-10-15

## README

# Transparent Logger

This logger binds console logging functions to produce log output with consistent code references in developer console.

It also supports log levels and a log hierarchy, such that you can control levels in the hierarchy.

A simple logger:

```coffee
  logger = require('js-logging')
  logger.setLevel('debug')
```

I developed this logger for atom packages and tests run in atom suite, so there is some specific support for this:

```coffee
  logger = require('js-logging')
  # logger starts per default in logging only errors
  logger.setSpecLevel('debug')
  log.debug 'this message appears only in atom spec test mode'
```

You have following logging functions:

```coffee
  logger = require('js-loggiing')
  fooLogger = logger.getLogger('foo')
  barLogger = logger.getLogger('foo.bar')
  oneMoreBarLogger = fooLogger.getLogger('bar')
  barLogger is oneMoreBarLogger # is true
  fooLogger.setLevel('info')
  barLogger.level # is also 'info' now
  barLogger.setLevel 'silent' # no logging at all

  logger.debug "debug message"
  logger.trace "stack trace at this position"
  logger.log   "a log message"
  logger.info  "information"
  logger.warn  "warning"
  logger.error "error"
```

Log levels are configured as follows:

| level  | value |
|--------|-------|
| silent | 0     |
| error  | 1     |
| warn   | 2     |
| info   | 3     |
| log    | 4     |
| trace  | 5     |
| debug  | 6     |

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