# js-zrim-proxy-logger

> Class to proxy logger

Latest version **0.1.0** (published 2017-09-24) · CECILL-2.1 license · 0 weekly downloads

## Install

```sh
npm install js-zrim-proxy-logger
pnpm add js-zrim-proxy-logger
yarn add js-zrim-proxy-logger
bun add js-zrim-proxy-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.1.0 |
| Published | 2017-09-24 |
| First published | 2017-09-24 |
| Weekly downloads | 0 |
| License | CECILL-2.1 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+10 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | NEGRO, Eric |
| Maintainers | yogo95 |
| Keywords | zrim-everything, logger, proxy |

## Links

- npm: https://www.npmjs.com/package/js-zrim-proxy-logger
- Repository: https://github.com/yogo95/js-zrim-proxy-logger
- Homepage: https://github.com/yogo95/js-zrim-proxy-logger#readme
- Issues: https://github.com/yogo95/js-zrim-proxy-logger/issues
- npm.io page: https://npm.io/package/js-zrim-proxy-logger

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) 4.17.4
- [winston](https://npm.io/package/winston.md) 2.3.1
- [js-zrim-utils](https://npm.io/package/js-zrim-utils.md) 0.1.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

- 0.1.0 (latest) — 2017-09-24

## README

# JavaScript Zrim Proxy Logger

## Introduction

Conatains proxy logger. Help to manage the logger around classes

## Default logger

You have 2 ways to define a default logger in you system. 
You can use the **defaultLogger** logger function:
```javascript
const defaultLogger = require('js-zrim-proxy-logger').defaultLogger;
defaultLogger.setDefaultLogger(null, myLogger);
```

This function only works for the same version of the package.
Another solution is to define a global default logger manager.

You must define the default logger manager using :
```javascript
_.set(global, 'eu.zrimeverything.core.defaultLoggerManager', myDefaultLoggerManager);
```
This should be the first thing your application is doing.

## Requirement

The logger manager must define a function name getVersion which returns the
implementation version. This may help the module to know how to use the manager.

## Version 1

The version 1 requires:<br/>
- string getVersion() : returns "1.m.p" with m you minor version and p your patch version.
- string[] listLoggerNames() : This function returns the list of know logger names
- Logger getLogger(string|null|undefined) : This function returns the logger 
- string[] listLoggerNames() : List the logger names known or available
to use with the given name. In case the name is null or undefined, the function
must return the default logger.
- void setLogger(string|null|undefined, Logger) : This function define
a logger for the given name

## Proxy logger

The proxy help to define a logger in your code without having the final logger yet defined.

The proxy can also add prefix on you message without having to take care of.

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