# winston-wingman

> Offers convenience functions for using the winston logger

Latest version **1.1.0** (published 2018-04-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install winston-wingman
pnpm add winston-wingman
yarn add winston-wingman
bun add winston-wingman
```

## 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.0 |
| Published | 2018-04-02 |
| First published | 2016-10-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1022.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Bill Hodges |
| Maintainers | wildbillh |
| Keywords | winston, convenience, functions |

## Links

- npm: https://www.npmjs.com/package/winston-wingman
- Repository: https://github.com/wildbillh/winston-wingman
- Homepage: https://github.com/wildbillh/winston-wingman#readme
- Issues: https://github.com/wildbillh/winston-wingman/issues
- npm.io page: https://npm.io/package/winston-wingman

## Dependencies (1)

- [winston](https://npm.io/package/winston.md) ^2.4.0

## 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.1.0 (latest) — 2018-04-02
- 1.0.8 — 2017-11-28
- 1.0.7 — 2016-12-14
- 1.0.6 — 2016-10-27
- 1.0.5 — 2016-10-27
- 1.0.4 — 2016-10-27
- 1.0.3 — 2016-10-27
- 1.0.2 — 2016-10-25
- 1.0.1 — 2016-10-25
- 1.0.0 — 2016-10-25

## README

# winston-wingman

[![Inline docs](http://inch-ci.org/github/wildbillh/winston-wingman.svg?branch=master)](http://inch-ci.org/github/wildbillh/winston-wingman)[![npm version](https://badge.fury.io/js/winston-wingman.svg)](https://badge.fury.io/js/winston-wingman)

## Synopsis
The winston-wingman module supplies common defaults to the winston logger.
It also offers an easy interface for modifying transports on the fly
and encapsulates the underlying loading.
Once the module has loaded, you can use either the exposed winston object, 
or just require winston in the normal way in your source files.
Usually the top level file in a project will require winston-wingman and make any configuration 
changes. All other modules will just require the winston module. 
See the documentation of the winston module for additional features; https://github.com/winstonjs/winston.

## Install
```
$ npm install winston-wingman --save
```


## Usage
```javascript
// In the main startup file configure the logger
let logger = require('winston-wingman');
let winston = logger.winston;

// All of your other js files that log, can use either below
// let winston = require('winston');
// let winston = require('winston-wingman').winston;

// change the name of the logfile to be used.
logger.mergeFileTransport({filename: 'logs/myspecialname.log'});

winston.info('logging is easy');

```

##Default Configuration

If no additional configurations are used, here are the defaults: 

```javascript
let currentConsoleTransport = {
    timestamp: (function() {return new Date().toLocaleString();}) ,
    colorize: true,
    level: 'info',
    handleExceptions: true,
    humanReadableUnhandledException: true
};

 let currentFileTransport = {
    filename: 'app.log',
    timestamp: (function() {return new Date().toLocaleString();}) ,
    level: 'info',
    handleExceptions: true,
    humanReadableUnhandledException: true,
    maxsize: 10000,
    maxFiles: 5,
    tailable: true,
    json: false,
    zippedArchive: true
};
```

## Documentation
The class is documented with JSDoc. 

## Author
Bill Hodges

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