<commit_before># iso-log

An isomorphic logger with sugar on top.

## Installation

```
yarn add iso-log
```

## Usage

```javascript
const log = require('iso-log');
log.setOptions({
	level: 'debug',
	trace: true,
	sourcemaps: true
});

log.debug('All set!');
```

### Options

```level``` - The log level to use.  Default: 'debug'

Valid levels are:

```
trace
debug
log
info
warn
error
```

If the level specified is ```info```, then ```info```, ```warn```, and ```error``` logs would be written to the console.  ```trace``` and ```debug``` logs would NOT be written to the console.

```trace``` - Whether to run a trace which will add the file and line number.  Default: true

```sourcemaps``` - Whether to try to resolve the original file and line number.  Will look for the sourcemap in the corresponding ```.map``` file.  For example, ```/some/js/file.js.map```.  Default: true

### Logging Examples

```
log.trace('log at level trace');
log.debug('log at level debug');
log.log('log at level log');
log.info('log at level info');
log.warn('log at level warn');
log.error('log at level error');

log.crit('log at level error'); // alias of 'error'
log.fatal('log at level error'); // alias of 'error'

// Anything that can be passed to console.log can be passed to the logger
log.debug({some: 'object here'});
log.debug('multiple things', 'getting logged here', {some: 'object here'});
```

### Screenshots

![Console](https://raw.githubusercontent.com/kengoldfarb/iso-log/master/screenshots/console.png)

![Terminal](https://raw.githubusercontent.com/kengoldfarb/iso-log/master/screenshots/terminal.png)<commit_msg>add timestamp to log and screenshots to readme<commit_after># iso-log

An isomorphic logger with sugar on top.

In browser console:

![Console](https://raw.githubusercontent.com/kengoldfarb/iso-log/master/screenshots/console.png)

And in terminal:

![Terminal](https://raw.githubusercontent.com/kengoldfarb/iso-log/master/screenshots/terminal.png)

## Installation

```
yarn add iso-log
```

## Usage

```javascript
const log = require('iso-log');
log.setOptions({
	level: 'debug',
	trace: true,
	sourcemaps: true
});

log.debug('All set!');
```

### Options

```level``` - The log level to use.  Default: 'debug'

Valid levels are:

```
trace
debug
log
info
warn
error
```

If the level specified is ```info```, then ```info```, ```warn```, and ```error``` logs would be written to the console.  ```trace``` and ```debug``` logs would NOT be written to the console.

```trace``` - Whether to run a trace which will add the file and line number.  Default: true

```sourcemaps``` - Whether to try to resolve the original file and line number.  Will look for the sourcemap in the corresponding ```.map``` file.  For example, ```/some/js/file.js.map```.  Default: true

### Logging Examples

```
log.trace('log at level trace');
log.debug('log at level debug');
log.log('log at level log');
log.info('log at level info');
log.warn('log at level warn');
log.error('log at level error');

log.crit('log at level error'); // alias of 'error'
log.fatal('log at level error'); // alias of 'error'

// Anything that can be passed to console.log can be passed to the logger
log.debug({some: 'object here'});
log.debug('multiple things', 'getting logged here', {some: 'object here'});
```
{'fraction_non_alphanumeric': 0.16944528645043952, 'fraction_numerical': 0.0, 'mean_word_length': 4.509181969949917, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4239448', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1032, 'n_words': 379}