mentie 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/modules/logging.js +7 -7
- package/package.json +1 -1
package/modules/logging.js
CHANGED
|
@@ -8,7 +8,7 @@ const should_log = levels => {
|
|
|
8
8
|
const loglevel = env.loglevel()
|
|
9
9
|
|
|
10
10
|
// Check if the loglevel matches this call
|
|
11
|
-
const valid_levels = [ '
|
|
11
|
+
const valid_levels = [ 'debug', 'info', 'warn', 'error' ]
|
|
12
12
|
|
|
13
13
|
// Check if the loglevel is valid
|
|
14
14
|
if( !valid_levels.includes( loglevel ) ) console.warn( `Invalid log level: ${ loglevel }` )
|
|
@@ -120,13 +120,13 @@ export function log( ...messages ) {
|
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
122
|
* Extremely verbose logs that you should probably never use.
|
|
123
|
-
* Only logs if ?loglevel= or LOG_LEVEL= is set to: '
|
|
123
|
+
* Only logs if ?loglevel= or LOG_LEVEL= is set to: 'debug'
|
|
124
124
|
* 🎯 Goal: log extremely verbose messages that you probably don't want to see
|
|
125
125
|
*/
|
|
126
|
-
log.
|
|
126
|
+
log.debug = function( ...messages ) {
|
|
127
127
|
|
|
128
128
|
// Check if the loglevel matches this call
|
|
129
|
-
const levels = [ '
|
|
129
|
+
const levels = [ 'debug' ]
|
|
130
130
|
|
|
131
131
|
// Log the messages if the loglevel matches
|
|
132
132
|
if( should_log( levels ) ) {
|
|
@@ -153,7 +153,7 @@ log.chatter = function( ...messages ) {
|
|
|
153
153
|
log.info = function( ...messages ) {
|
|
154
154
|
|
|
155
155
|
// Check if the loglevel matches this call
|
|
156
|
-
const levels = [ 'info', '
|
|
156
|
+
const levels = [ 'info', 'debug' ]
|
|
157
157
|
|
|
158
158
|
// Log the messages if the loglevel matches
|
|
159
159
|
if( env.is_emulator() || should_log( levels ) ) {
|
|
@@ -178,7 +178,7 @@ log.info = function( ...messages ) {
|
|
|
178
178
|
log.warn = function( ...messages ) {
|
|
179
179
|
|
|
180
180
|
// Check if the loglevel matches this call
|
|
181
|
-
const levels = [ 'warn', 'info', '
|
|
181
|
+
const levels = [ 'warn', 'info', 'debug' ]
|
|
182
182
|
|
|
183
183
|
// Log the messages if the loglevel matches
|
|
184
184
|
if( dev || should_log( levels ) ) {
|
|
@@ -203,7 +203,7 @@ log.warn = function( ...messages ) {
|
|
|
203
203
|
log.error = function( ...messages ) {
|
|
204
204
|
|
|
205
205
|
// Check if the loglevel matches this call
|
|
206
|
-
const levels = [ 'error', 'warn', 'info', '
|
|
206
|
+
const levels = [ 'error', 'warn', 'info', 'debug' ]
|
|
207
207
|
if( !should_log( levels ) ) return
|
|
208
208
|
|
|
209
209
|
// Annotate the provided messages
|