# basic-logger

> basic logger supporting error, warning, debug and info messages with timestamp.

Latest version **0.4.4** (published 2012-12-17) · 0 weekly downloads

## Install

```sh
npm install basic-logger
pnpm add basic-logger
yarn add basic-logger
bun add basic-logger
```

## 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.4.4 |
| Published | 2012-12-17 |
| First published | 2011-12-21 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4 |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Stefan Bilharz |
| Maintainers | drd0rk |
| Keywords | basic logger, log, logging, timestamp, log to console |

## Links

- npm: https://www.npmjs.com/package/basic-logger
- Homepage: https://github.com/drd0rk/logger
- Issues: https://github.com/drd0rk/logger/issues/
- npm.io page: https://npm.io/package/basic-logger

## Dependencies (2)

- [pkginfo](https://npm.io/package/pkginfo.md) 0.2.x
- [underscore](https://npm.io/package/underscore.md) 1.2.x

## 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.4.4 (latest) — 2012-12-17
- 0.4.3 — 2012-09-05
- 0.4.2 — 2012-08-28
- 0.4.1 — 2012-08-16
- 0.4.0 — 2012-02-12
- 0.3.3 — 2012-01-23
- 0.3.2 — 2012-01-22
- 0.3.1 — 2012-01-22
- 0.3.0 — 2012-01-22
- 0.2.1 — 2011-12-28
- 0.2.0 — 2011-12-22
- 0.1.0 — 2011-12-21

## README

Basic-Logger
============

Basic logger for nodejs supporting error, warning, info, debug and trace messages with (or without) timestamp.
Everything you log is printed to the console.

Installation
------------

	npm install basic-logger

Usage
-----

	var Logger = require('basic-logger');
	// configure level one time, it will be set to every instance of the logger
	Logger.setLevel('warning'); // only warnings and errors will be shown
	Logger.setLevel('warning', true); // only warnings and errors will be shown and no message about the level change will be printed

	var customConfig = {
		showMillis: true;
		showTimestamp: true;
	};

	var log = new Logger(customConfig) // custom config parameters will be used, defaults will be used for the other parameters

	log.error('An error occurred');
	log.warn('I am not kidding!');
	log.info('you just screwed this');
	log.debug('this code is still alive...');
	log.trace('we are here.');
	
Config options
--------------

* `showTimestamp` - Show the timestamp with every message.
* `showMillis` - Show milliseconds in the timestamp.
* `printObjFunc` - The function to apply objects to, if logged. Default is util.inspect.
* `prefix` - String that is prepended to every message logged with this instance.

Test
----

You'll need `vows`. Then just run `npm test`.

Future versions
---------------

* support for colored log messages
* log to file

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