An open API service indexing awesome lists of open source software.

https://github.com/scriptex/log

Dynamic console logging - log using the optimal console method. Provides method overwriting, beforeLog and afterLog hooks.
https://github.com/scriptex/log

console-log log logging

Last synced: 3 months ago
JSON representation

Dynamic console logging - log using the optimal console method. Provides method overwriting, beforeLog and afterLog hooks.

Awesome Lists containing this project

README

          

[![Github Build](https://github.com/scriptex/log/workflows/Build/badge.svg)](https://github.com/scriptex/log/actions?query=workflow%3ABuild)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/34d3d75710534dc6a38c3584a1dcd068)](https://www.codacy.com/gh/scriptex/log/dashboard?utm_source=github.com&utm_medium=referral&utm_content=scriptex/log&utm_campaign=Badge_Grade)
[![Codebeat Badge](https://codebeat.co/badges/d765a4c8-2c0e-44f2-89c3-fa364fdc14e6)](https://codebeat.co/projects/github-com-scriptex-log-master)
[![CodeFactor Badge](https://www.codefactor.io/repository/github/scriptex/log/badge)](https://www.codefactor.io/repository/github/scriptex/log)
[![DeepScan grade](https://deepscan.io/api/teams/3574/projects/5257/branches/40799/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=3574&pid=5257&bid=40799)
[![Analytics](https://ga-beacon-361907.ew.r.appspot.com/UA-83446952-1/github.com/scriptex/log/README.md?pixel)](https://github.com/scriptex/log/)

# Log

> Dynamic console logging - log using the optimal console method.
> Provides method overwriting, beforeLog and afterLog hooks.

## Visitor stats

![GitHub stars](https://img.shields.io/github/stars/scriptex/log?style=social)
![GitHub forks](https://img.shields.io/github/forks/scriptex/log?style=social)
![GitHub watchers](https://img.shields.io/github/watchers/scriptex/log?style=social)
![GitHub followers](https://img.shields.io/github/followers/scriptex?style=social)

## Code stats

![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/scriptex/log)
![GitHub repo size](https://img.shields.io/github/repo-size/scriptex/log?style=plastic)
![GitHub language count](https://img.shields.io/github/languages/count/scriptex/log?style=plastic)
![GitHub top language](https://img.shields.io/github/languages/top/scriptex/log?style=plastic)
![GitHub last commit](https://img.shields.io/github/last-commit/scriptex/log?style=plastic)

## Usage

```javascript
// String
log('string');

// number
log(1);

// array
log(['test', '1', { object: 'prop' }, ['array']]);

// function
log(() => {
const a = 1;
const b = 2;

return a + b;
});

// object
log({
prop1: 'value1',
prop2: {
nestedProp1: 'nestedValue1',
nestedProp2: 'nestedValue2',
nestedProp3: 'nestedValue3',
nestedProp4: 'nestedValue4'
},
prop3: 'value3',
prop4: 'value4'
});

// null
log(null);

// undefined
log(undefined);
log(void 0);

// boolean
log(true);

// RegExp
log(/^[a-z]{3,}$/);

// Date
log(new Date());
log(new Date().getTime());

// Symbol
log(Symbol('foo'));

// Constructor
log(function () {});
log(class A {});
log(Array);
log(Function);
log(new Function());

// Map
const map = new Map();

map.set('key1', 'value1');
map.set('key2', 'value2');

log(map);

// set
const set = new Set();

set.add('value1');
set.add('value2');

log(set);
```

## LICENSE

MIT

---


Connect with me:






 



 



 



 



 



 



 



 



 



 



 



---


Support and sponsor my work: