You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+49-24
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,9 @@
14
14
-[Introduction](#introduction)
15
15
-[Install](#install)
16
16
-[Usage](#usage)
17
+
-[Properties](#properties)
18
+
-[Code example](#code)
19
+
-[Production tips](#Production tips)
17
20
-[Maintainers](#maintainers)
18
21
-[Contribute](#contribute)
19
22
-[License](#license)
@@ -24,26 +27,21 @@
24
27
25
28
## Introduction
26
29
27
-
vuejs-logger is a logging library that enables logging for Vue applications. It restricts log messages that are higher than the specified log level. Features include :
30
+
vuejs-logger is a tool that enables configurable logging for Vue applications. Features include :
28
31
32
+
- Output restriction based on selected loglevel.
33
+
- Automatically JSON.stringify() the (reactive) properties passed to the logger.
34
+
- Configurable options to customize output for a log messages.
29
35
- Colored console messages for $log.warning, $log.error and $log.fatal.
30
-
- Possibility to automatically JSON.stringify() the (reactive) properties passed to the logger.
31
-
- Possibility to display the log level in the console.
Vue.$log.debug('log from function outside component.')
107
+
Vue.$log.debug('log from function outside component.');
102
108
}
103
109
```
104
110
111
+
112
+
#### Screenshot
113
+
105
114

106
115
116
+
## Production tips
117
+
The plugin can be disabled for production or a lower logLevel can be set to minimize output (as shown in [usage](#usage) ). If the logLevel is set to 'fatal' the plugin will
118
+
ignore all calls with less important loglevels in the code.
119
+
120
+
```js
121
+
functionfoo() {
122
+
// these statements will print nothing if the logLevel is set to 'fatal'. But they will compile just fine.
123
+
this.$log.debug('test', 'bar')
124
+
this.$log.info('test')
125
+
this.$log.warn('test')
126
+
this.$log.error('test', 'foo')
127
+
// this statement will print if the logLevel is set to 'fatal'
0 commit comments