18.0.14 • Published 3 months ago

ng2-logger v18.0.14

Weekly downloads
1,841
License
MIT
Repository
github
Last release
3 months ago

taon-logger (ng2-logger)

  • Part of taon.io
  • Isomorphic Logger for TypeScript and JavaScript apps.
  • Purpose:
    • usefull/elegant backend/frontend logger

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 (or any taon's lib/app):

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') );
18.0.11

4 months ago

18.0.12

4 months ago

18.0.14

3 months ago

16.100.5

7 months ago

16.100.7

7 months ago

16.100.6

7 months ago

16.100.9

7 months ago

16.100.8

7 months ago

18.0.8

4 months ago

18.0.6

4 months ago

18.0.5

4 months ago

16.444.2

7 months ago

16.444.1

7 months ago

16.444.4

6 months ago

16.444.6

6 months ago

16.444.5

6 months ago

16.444.8

6 months ago

16.444.7

6 months ago

16.100.10

7 months ago

18.0.4

4 months ago

18.0.3

4 months ago

18.0.2

4 months ago

18.0.1

4 months ago

16.444.15

5 months ago

16.444.14

5 months ago

16.444.13

5 months ago

16.444.12

5 months ago

16.444.11

5 months ago

16.100.4

7 months ago

16.100.3

7 months ago

16.100.2

7 months ago

16.100.1

7 months ago

16.5.30

8 months ago

16.5.29

8 months ago

16.5.28

8 months ago

16.5.27

9 months ago

16.5.26

9 months ago

16.5.25

9 months ago

16.5.24

9 months ago

16.5.23

9 months ago

16.5.22

9 months ago

16.5.19

9 months ago

16.5.18

9 months ago

16.5.21

9 months ago

16.5.20

9 months ago

16.5.17

9 months ago

16.5.16

9 months ago

16.5.15

9 months ago

16.5.14

10 months ago

16.5.13

11 months ago

16.5.12

11 months ago

16.5.11

11 months ago

16.5.9

11 months ago

16.5.8

11 months ago

16.5.10

11 months ago

16.5.6

12 months ago

16.5.5

12 months ago

16.5.4

12 months ago

16.5.3

1 year ago

16.5.2

1 year ago

16.5.1

1 year ago

16.0.9

1 year ago

16.0.8

1 year ago

16.0.10

1 year ago

13.1.23

2 years ago

13.1.24

2 years ago

13.1.25

2 years ago

16.0.7

1 year ago

16.0.2

2 years ago

16.0.4

2 years ago

16.0.3

2 years ago

13.1.12

2 years ago

13.1.13

2 years ago

13.1.14

2 years ago

13.1.15

2 years ago

13.1.16

2 years ago

13.1.17

2 years ago

13.1.18

2 years ago

13.1.19

2 years ago

13.1.21

2 years ago

13.1.22

2 years ago

13.1.20

2 years ago

13.1.10

2 years ago

13.1.11

2 years ago

13.1.9

2 years ago

13.0.26

2 years ago

13.1.7

2 years ago

13.1.8

2 years ago

13.1.5

2 years ago

13.1.6

2 years ago

13.1.3

2 years ago

13.1.4

2 years ago

13.1.1

2 years ago

13.1.2

2 years ago

13.0.25

2 years ago

13.0.20

2 years ago

13.0.21

2 years ago

13.0.22

2 years ago

13.0.17

3 years ago

13.0.18

3 years ago

13.0.19

3 years ago

13.0.12

3 years ago

13.0.13

3 years ago

13.0.14

3 years ago

13.0.15

3 years ago

13.0.16

3 years ago

8.0.30

3 years ago

13.0.8

3 years ago

13.0.9

3 years ago

13.0.6

3 years ago

13.0.7

3 years ago

13.0.4

3 years ago

13.0.5

3 years ago

13.0.2

3 years ago

13.0.3

3 years ago

13.0.1

3 years ago

8.0.25

3 years ago

8.0.29

3 years ago

8.0.28

3 years ago

13.0.10

3 years ago

13.0.11

3 years ago

8.0.23

3 years ago

8.0.22

3 years ago

8.0.24

3 years ago

8.0.10

3 years ago

8.0.12

3 years ago

8.0.11

3 years ago

8.0.14

3 years ago

8.0.13

3 years ago

8.0.16

3 years ago

8.0.15

3 years ago

8.0.18

3 years ago

8.0.17

3 years ago

8.0.19

3 years ago

8.0.20

3 years ago

8.0.9

3 years ago

8.0.8

3 years ago

8.0.5

3 years ago

8.0.6

3 years ago

7.0.13

3 years ago

7.0.18

3 years ago

8.0.4

3 years ago

8.0.1

3 years ago

8.0.2

3 years ago

5.0.23

3 years ago

5.0.17

3 years ago

5.0.18

3 years ago

5.0.15

3 years ago

5.0.16

3 years ago

5.0.14

3 years ago

5.0.11

4 years ago

5.0.12

4 years ago

5.0.13

4 years ago

5.0.9

4 years ago

5.0.8

4 years ago

5.0.7

4 years ago

5.0.10

4 years ago

5.0.6

4 years ago

5.0.5

4 years ago

5.0.4

4 years ago

5.0.3

4 years ago

5.0.2

4 years ago

4.0.15

4 years ago

4.0.14

4 years ago

4.0.13

4 years ago

4.0.12

4 years ago

4.0.9

4 years ago

4.0.8

4 years ago

4.0.7

4 years ago

4.0.6

4 years ago

4.0.5

4 years ago

4.0.4

4 years ago

4.0.3

4 years ago

4.0.2

4 years ago

3.0.14

4 years ago

3.0.13

4 years ago

3.0.12

5 years ago

3.0.11

5 years ago

3.0.10

5 years ago

2.0.48

6 years ago

2.0.47

6 years ago

2.0.46

6 years ago

2.0.45

6 years ago

2.0.44

6 years ago

2.0.43

6 years ago

2.0.42

6 years ago

2.0.41

6 years ago

2.0.40

6 years ago

2.0.39

6 years ago

2.0.38

6 years ago

2.0.37

6 years ago

2.0.36

6 years ago

2.0.35

7 years ago

2.0.34

7 years ago

2.0.32

7 years ago

2.0.31

7 years ago

2.0.30

7 years ago

2.0.29

7 years ago

2.0.26

7 years ago

2.0.25

7 years ago

2.0.23

7 years ago

2.0.21

7 years ago

2.0.20

7 years ago

2.0.19

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.4

7 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.1.21

8 years ago

0.1.20

8 years ago

0.1.16

8 years ago

0.1.15

8 years ago

0.1.14

8 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.0.27

9 years ago

0.0.26

9 years ago

0.0.25

9 years ago

0.0.24

9 years ago

0.0.22

9 years ago

0.0.21

9 years ago

0.0.20

9 years ago

0.0.18

9 years ago

0.0.17

9 years ago

0.0.16

9 years ago

0.0.15

9 years ago

0.0.14

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.5

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago