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: src/docs/api/Log.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,20 +10,37 @@ Basic logging
10
10
11
11
Basic logging
12
12
13
+
```
14
+
this.log.info('Setting switch state to:', value);
15
+
```
16
+
13
17
> this.log.success
14
18
15
19
Messages are highlighted in green
16
20
( Since Homebridge 1.8.0 )
17
21
22
+
```
23
+
this.log.success(`Discovery finished, found ${this.receiverCount} Yamaha AVR's and creating ${this.receivers.length} HomeKit accessories.`);
24
+
```
18
25
> this.log.warn
19
26
20
27
Messages are highlighted in yellow, and with the console error logger
21
28
29
+
```
30
+
this.log.warn(`Zone controller for ${zoneName} already exists`);
31
+
```
22
32
> this.log.error
23
33
24
34
Messages are highlighted in red, and with the console error logger
25
35
36
+
```
37
+
this.log.error(`Error getting system config for ${service.name}:`, error);
38
+
```
26
39
> this.log.debug
27
40
28
-
Messages are highlighted in gray
41
+
Messages are highlighted in gray<br>
29
42
Messages with DEBUG level are only displayed if explicitly enabled. Debug level logging is enabled with the homebridge command line options -D or --debug.
43
+
44
+
```
45
+
this.log.debug(`Got volume percent of ${v}%, ${p}%`, volume, this.zone);
0 commit comments