All Projects → darekf77 → ng2-logger

darekf77 / ng2-logger

Licence: MIT license
Isomorphic logger for Browser and NodeJS, ( typescript / javascript ) apps

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to ng2-logger

missionlog
🚀 lightweight logging • supports level based filtering and tagging • weighs in at around 500 bytes
Stars: ✭ 19 (-68.85%)
Mutual labels:  isomorphic, logger
logops
Really simple and performant logger for node projects compatible with any kind of deployments as your server operations/environment defined
Stars: ✭ 20 (-67.21%)
Mutual labels:  logger
l
Golang Pretty Logger
Stars: ✭ 51 (-16.39%)
Mutual labels:  logger
perforce-commit-discord-bot
🗒️ ✏️Posts the most recent commit messages from a Perforce version control server to a Discord channel.
Stars: ✭ 22 (-63.93%)
Mutual labels:  logger
grand central
State-management and action-dispatching for Ruby apps
Stars: ✭ 20 (-67.21%)
Mutual labels:  isomorphic
universal-react-relay-starter-kit
A starter kit for React in combination with Relay including a GraphQL server, server side rendering, code splitting, i18n, SEO.
Stars: ✭ 14 (-77.05%)
Mutual labels:  isomorphic
Torch-Scope
A Toolkit for Training, Tracking, Saving Models and Syncing Results
Stars: ✭ 62 (+1.64%)
Mutual labels:  logger
spdlog-python
python wrapper around C++ spdlog ([email protected]:gabime/spdlog.git)
Stars: ✭ 46 (-24.59%)
Mutual labels:  logger
DRF-API-Logger
An API Logger for your Django Rest Framework project.
Stars: ✭ 184 (+201.64%)
Mutual labels:  logger
LogDNA-Android-Client
Android client for LogDNA
Stars: ✭ 22 (-63.93%)
Mutual labels:  logger
Web-Tracker
Stand alone program that Tracks/Logs all the opened websites in the Chrome Browser. Even incognito! *No need to install anything in browser*
Stars: ✭ 34 (-44.26%)
Mutual labels:  logger
loggers
Abstract logging for Golang projects. A kind of log4go in the spirit of log4j
Stars: ✭ 17 (-72.13%)
Mutual labels:  logger
lines-logger
Browser logger that rests lines in peace
Stars: ✭ 26 (-57.38%)
Mutual labels:  logger
tiny-typed-emitter
Fully type-checked NodeJS EventEmitter
Stars: ✭ 96 (+57.38%)
Mutual labels:  nodejs-library
alert
Cross-platform, isomorphic alert, for Node and browser (previously alert-node)
Stars: ✭ 27 (-55.74%)
Mutual labels:  isomorphic
WormholyForObjectiveC
Network debugging made easy,This network debugging tool is developed based on the swift version of Wormholy.
Stars: ✭ 21 (-65.57%)
Mutual labels:  logger
ves
Vue SSR(Server Side Render) Web Framework for Egg
Stars: ✭ 23 (-62.3%)
Mutual labels:  isomorphic
logback-access-spring-boot-starter
Spring Boot Starter for Logback-access.
Stars: ✭ 153 (+150.82%)
Mutual labels:  logger
G-Earth
Cross-platform Habbo packet manipulator
Stars: ✭ 52 (-14.75%)
Mutual labels:  logger
wlog
A simple logging interface that supports cross-platform color and concurrency.
Stars: ✭ 59 (-3.28%)
Mutual labels:  logger

ng2-logger

Isomorphic Logger for TypeScript and JavaScript apps.

You can use this logger in your apps with any

TS/JS framework.

See what is going on in your app!

Now chrome console logs are full of colors!

Modules marked

See nice server logs:

Modules marked

To install package run:

npm install ng2-logger --save

First import proper version for your environment:

Nodejs server:

import { Log, Level } from  'ng2-logger'

or Browser:

import { Log, Level } from  'ng2-logger/browser'  // new javascript module: es2015 + esnext + angular ivy support

Simple use:

In your file with log:

const  log  =  Log.create('books');

or if you wanna just log errors and warnings :

const  log  =  Log.create('books', Level.ERROR, Level.WARN);

'books' is current class or anything inside .ts/.js file.

You can also assign static color to specific module in application (browser for now only):

log.color  =  'red';

After inited log you are able to start debugging:

log.d('object',obj) // console.log

log.er('object',obj) // console.error

log.i('object',obj) // console.info

log.w('object',obj) // console.warn

or

log.debug('object',obj) // console.log

log.error('object',obj) // console.error

log.info('object',obj) // console.info

log.warn('object',obj) // console.warn

Production mode


You will not see anyting in prduction mode:

// enable production mode in your app

...

Log.setProductionMode();

...

// your app code with console and ng2-logger logs

It is important to set production mode before any log messages are executed.

This will ensure that log messages that should not be seen are leaked out.

Selective debug - global settings


Optional specify what you wanna see in yours debug console.

This settings will override settings from files.

Log.setProductionMode();

Log.onlyModules('src:books', 'src:records', 'src:page:login');

Log.onlyLevel(Level.ERROR,Level.INFO);

Specifying onlyModules as regular expression(s)


In the above example you'll notice module:books and module:records were specified.

you might be using such syntax for namespace hierarchy etc. You may also pass in one or more regular

expression string(s) to the onlyModule function to specify a selection of modules you wish

to show, for instances those whose name begins with src:

  

Log.onlyModules( new  RegEx('^.src') );
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].