# nf-logger

> A simple logger service for Angular apps, part of the nCore.

Latest version **1.2.0** (published 2016-12-07) · MIT license · 0 weekly downloads

## Install

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

## 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.2.0 |
| Published | 2016-12-07 |
| First published | 2016-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | https://github.com/nodes-frontend/nLogger/graphs/contributors |
| Maintainers | dennishn |
| Keywords | angular, logger |

## Links

- npm: https://www.npmjs.com/package/nf-logger
- Repository: https://github.com/nodes-frontend/nLogger
- Issues: https://github.com/nodes-frontend/nLogger/issues
- npm.io page: https://npm.io/package/nf-logger

## 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.2.0 (latest) — 2016-12-07
- 1.1.0 — 2016-03-30
- 1.0.0 — 2016-03-30

## README

# nCore.nLogger
[![npm version](https://badge.fury.io/js/nf-logger.svg)](https://badge.fury.io/js/nf-logger)
[![Build Status](https://travis-ci.org/nodes-frontend/nLogger.svg?branch=master)](https://travis-ci.org/nodes-frontend/nLogger)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Coverage Status](https://coveralls.io/repos/github/nodes-frontend/nLogger/badge.svg?branch=master)](https://coveralls.io/github/nodes-frontend/nLogger?branch=master)
[![devDependency Status](https://david-dm.org/nodes-frontend/nLogger/dev-status.svg)](https://david-dm.org/nodes-frontend/nLogger#info=devDependencies)
[![Dependency Status](https://david-dm.org/nodes-frontend/nLogger.svg)](https://david-dm.org/nodes-frontend/nLogger)

A module for logging functionality. This is not for production.
Please note that we do not disable console methods outside of our angular application scope.

When the global DEBUG_ENV variable is set to false we disable all console methods based on your config.

## Configuration

Use the provider to overwrite defaults.

```javascript
var myConfig = nLoggerConfigProvider.configure();
nLoggerConfigProvider.configure(myConfig);
```

The .configure() method acts as a getter if no arguments is provided and a setter otherwise.

Default settings:
 
```javascript
nLoggerConfigProvider.configure({
	blacklist: ['log', 'warn', 'info', 'error'], //These methods are disabled in prod env
	console: {
		enable: true //Disable the logger console prints
	},
	messages: {
		enable: true, //Disable the logger message prints
		dismissOnTimeout: false,
		timeout: 4000,
		dismissButton: false,
		dismissButtonHtml: '&times;',
		dismissOnClick: true
	}
});
``` 

## Usage

All logging methods takes 3 arguments:

```javascript
nLogger.method(message, data, methodSpecificOptions);
```

Message and data can be of any type, methodSpecificOptions can overwrite the defaults and must be an object.

```javascript
angular.module('demoApp', ['nCore'])
	.run(function(nLogger) {

		nLogger.log('nLogger.log', {data: 'foo'}, {dismissButton: false});

		nLogger.error('nLogger.error', new Error('Error'));

		nLogger.warning('nLogger.warning', {o: '1'});

		nLogger.success('nLogger.success', [0,1,2,3,{a: 1}]);

		nLogger.info('nLogger.info', window.console);
		
	});
```

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