18.0.14 • Published 2 months ago

ng2-logger v18.0.14

Weekly downloads
1,841
License
MIT
Repository
github
Last release
2 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

3 months ago

18.0.12

3 months ago

18.0.14

2 months ago

16.100.5

6 months ago

16.100.7

6 months ago

16.100.6

6 months ago

16.100.9

6 months ago

16.100.8

6 months ago

18.0.8

3 months ago

18.0.6

3 months ago

18.0.5

3 months ago

16.444.2

6 months ago

16.444.1

6 months ago

16.444.4

5 months ago

16.444.6

5 months ago

16.444.5

5 months ago

16.444.8

5 months ago

16.444.7

5 months ago

16.100.10

6 months ago

18.0.4

3 months ago

18.0.3

3 months ago

18.0.2

3 months ago

18.0.1

3 months ago

16.444.15

4 months ago

16.444.14

4 months ago

16.444.13

4 months ago

16.444.12

4 months ago

16.444.11

4 months ago

16.100.4

6 months ago

16.100.3

6 months ago

16.100.2

6 months ago

16.100.1

6 months ago

16.5.30

7 months ago

16.5.29

7 months ago

16.5.28

7 months ago

16.5.27

8 months ago

16.5.26

8 months ago

16.5.25

8 months ago

16.5.24

8 months ago

16.5.23

8 months ago

16.5.22

8 months ago

16.5.19

8 months ago

16.5.18

8 months ago

16.5.21

8 months ago

16.5.20

8 months ago

16.5.17

8 months ago

16.5.16

8 months ago

16.5.15

8 months ago

16.5.14

9 months ago

16.5.13

10 months ago

16.5.12

10 months ago

16.5.11

10 months ago

16.5.9

10 months ago

16.5.8

10 months ago

16.5.10

10 months ago

16.5.6

11 months ago

16.5.5

11 months ago

16.5.4

11 months ago

16.5.3

11 months ago

16.5.2

12 months ago

16.5.1

12 months ago

16.0.9

1 year ago

16.0.8

1 year ago

16.0.10

1 year ago

13.1.23

1 year ago

13.1.24

1 year ago

13.1.25

1 year ago

16.0.7

1 year ago

16.0.2

1 year ago

16.0.4

1 year ago

16.0.3

1 year 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

2 years ago

13.0.18

2 years ago

13.0.19

2 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

3 years ago

5.0.12

3 years ago

5.0.13

3 years ago

5.0.9

3 years ago

5.0.8

3 years ago

5.0.7

3 years ago

5.0.10

3 years ago

5.0.6

3 years ago

5.0.5

3 years ago

5.0.4

3 years ago

5.0.3

3 years ago

5.0.2

3 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

4 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

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.0.27

8 years ago

0.0.26

8 years ago

0.0.25

8 years ago

0.0.24

8 years ago

0.0.22

8 years ago

0.0.21

8 years ago

0.0.20

8 years ago

0.0.18

8 years ago

0.0.17

8 years ago

0.0.16

8 years ago

0.0.15

8 years ago

0.0.14

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.5

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago