-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
Copy pathindex.js
111 lines (93 loc) · 3.12 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/**
Inside Ember-Metal, simply uses the methods from `imports.console`.
Override this to provide more robust logging functionality.
@class Logger
@namespace Ember
@public
*/
export default {
/**
Logs the arguments to the console.
You can pass as many arguments as you want and they will be joined together with a space.
```javascript
var foo = 1;
Ember.Logger.log('log value of foo:', foo);
// "log value of foo: 1" will be printed to the console
```
@method log
@for Ember.Logger
@param {*} arguments
@public
*/
log() { return console.log(...arguments);}, // eslint-disable-line no-console
/**
Prints the arguments to the console with a warning icon.
You can pass as many arguments as you want and they will be joined together with a space.
```javascript
Ember.Logger.warn('Something happened!');
// "Something happened!" will be printed to the console with a warning icon.
```
@method warn
@for Ember.Logger
@param {*} arguments
@public
*/
warn() { return console.warn(...arguments);}, // eslint-disable-line no-console
/**
Prints the arguments to the console with an error icon, red text and a stack trace.
You can pass as many arguments as you want and they will be joined together with a space.
```javascript
Ember.Logger.error('Danger! Danger!');
// "Danger! Danger!" will be printed to the console in red text.
```
@method error
@for Ember.Logger
@param {*} arguments
@public
*/
error() { return console.error(...arguments);}, // eslint-disable-line no-console
/**
Logs the arguments to the console.
You can pass as many arguments as you want and they will be joined together with a space.
```javascript
var foo = 1;
Ember.Logger.info('log value of foo:', foo);
// "log value of foo: 1" will be printed to the console
```
@method info
@for Ember.Logger
@param {*} arguments
@public
*/
info() { return console.info(...arguments);}, // eslint-disable-line no-console
/**
Logs the arguments to the console in blue text.
You can pass as many arguments as you want and they will be joined together with a space.
```javascript
var foo = 1;
Ember.Logger.debug('log value of foo:', foo);
// "log value of foo: 1" will be printed to the console
```
@method debug
@for Ember.Logger
@param {*} arguments
@public
*/
debug() {
return console.debug && console.debug(...arguments) || console.info(...arguments); // eslint-disable-line no-console
},
/**
If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace.
```javascript
Ember.Logger.assert(true); // undefined
Ember.Logger.assert(true === false); // Throws an Assertion failed error.
Ember.Logger.assert(true === false, 'Something invalid'); // Throws an Assertion failed error with message.
```
@method assert
@for Ember.Logger
@param {Boolean} bool Value to test
@param {String} message Assertion message on failed
@public
*/
assert() { return console.assert(...arguments);} // eslint-disable-line no-console
};