# raptor-logging

> Module to support the optimized delivery of web application resources

Latest version **1.1.3** (published 2017-08-03) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install raptor-logging
pnpm add raptor-logging
yarn add raptor-logging
bun add raptor-logging
```

## 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.1.3 |
| Published | 2017-08-03 |
| First published | 2014-01-13 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Patrick Steele-Idem |
| Maintainers | austinkelleher, pnidem, philidem |

## Links

- npm: https://www.npmjs.com/package/raptor-logging
- Repository: https://github.com/raptorjs/raptor-logging
- Homepage: https://github.com/raptorjs/raptor-logging#readme
- Issues: https://github.com/raptorjs/raptor-logging/issues
- npm.io page: https://npm.io/package/raptor-logging

## Dependencies (2)

- [raptor-polyfill](https://npm.io/package/raptor-polyfill.md) ^1.0.0
- [raptor-stacktraces](https://npm.io/package/raptor-stacktraces.md) ^1.0.0

## Recent versions

- 1.1.3 (latest) — 2017-08-03
- 1.1.2 — 2016-05-31
- 1.1.1 — 2016-04-27
- 1.1.0 — 2016-04-08
- 1.0.8 — 2016-01-27
- 1.0.7 — 2015-11-17
- 1.0.6 — 2015-05-29
- 1.0.5 — 2014-12-17
- 1.0.4 — 2014-11-07
- 1.0.3 — 2014-10-16
- 1.0.2 — 2014-10-08
- 1.0.1 — 2014-09-22
- 1.0.1-beta — 2014-09-04
- 1.0.0-beta — 2014-09-04
- 0.2.6-beta — 2014-06-18
- … 7 more at https://npm.io/package/raptor-logging/versions

## README

raptor-logging
==============

Super simple logging system that works on the server and and in the browser.

# Example

___projects/logging-test/run.js:___

```javascript
require('raptor-logging').configure({
    loggers: {
        'ROOT': 'WARN',
        'logging-test': 'DEBUG'
    }
});

// ...

var logger = require('raptor-logging').logger(module);
logger.debug('This is a debug message');
```

Output:

```
DEBUG logging-test/run: This is a debug message
```

You can also pass multiple arguments, as well as non-String arguments to the logging methods.

For example:

```javascript
var logger = require('raptor-logging').logger(module);
logger.debug('This is a debug message', {foo: 'bar'});
```

Output:

```
DEBUG logging-test/run: This is a debug message { foo: 'bar' }
```

# Installation

```bash
npm install raptor-logging --save
```

# API

## logger(module)

Returns a new `Logger` instance whose name is based on the filename associated with the Node.js module object.

Example:

```javascript
var logger = require('raptor-logging').logger(module);
logger.debug('Hello World');
```

## logger(name)

Returns a new `Logger` instance with the given name

Example:

```javascript
var logger = require('raptor-logging').logger('foo');
logger.debug('Hello World');
```

Output:

```
DEBUG foo: Hello World
```

## configure(options)

Supported options:

- `loggers`: A mapping of logger prefixes to log levels (see below)
- `appenders`: An array of appender instances (see [ConsoleAppender](./lib/ConsoleAppender.js) for an example appender implementation)

Example:

```javascript
require('raptor-logging').configure({
    'ROOT': 'WARN',
    'foo': 'DEBUG',
    'foo/bar': 'WARN',
});
```

## Logger

Methods:

- isTraceEnabled() : boolean
- isDebugEnabled() : boolean
- isInfoEnabled() : boolean
- isWarnEnabled() : boolean
- isErrorEnabled() : boolean
- isFatalEnabled() : boolean
- dump(arg1, arg2, ...)
- trace(arg1, arg2, ...)
- debug(arg1, arg2, ...)
- info(arg1, arg2, ...)
- warn(arg1, arg2, ...)
- error(arg1, arg2, ...)
- fatal(arg1, arg2, ...)

# Contributors

* [Patrick Steele-Idem](https://github.com/patrick-steele-idem) (Twitter: [@psteeleidem](http://twitter.com/psteeleidem))

# Contribute

Pull Requests welcome. Please submit Github issues for any feature enhancements, bugs or documentation problems.

# License

Apache License v2.0

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