Skip to content

Commit 7b8d3d3

Browse files
committed
Updated log.md
1 parent 56fd6d9 commit 7b8d3d3

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

scripts/sitemap.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const sitemap = [
1414
baseUrl + '/api/platform-plugins',
1515
baseUrl + '/api/service',
1616
baseUrl + '/api/characteristics',
17+
baseUrl + '/api/log',
1718
baseUrl + '/config-schema',
1819
baseUrl + '/categories',
1920
];

src/docs/api/Log.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,37 @@ Basic logging
1010
1111
Basic logging
1212

13+
```
14+
this.log.info('Setting switch state to:', value);
15+
```
16+
1317
> this.log.success
1418
1519
Messages are highlighted in green
1620
( Since Homebridge 1.8.0 )
1721

22+
```
23+
this.log.success(`Discovery finished, found ${this.receiverCount} Yamaha AVR's and creating ${this.receivers.length} HomeKit accessories.`);
24+
```
1825
> this.log.warn
1926
2027
Messages are highlighted in yellow, and with the console error logger
2128

29+
```
30+
this.log.warn(`Zone controller for ${zoneName} already exists`);
31+
```
2232
> this.log.error
2333
2434
Messages are highlighted in red, and with the console error logger
2535

36+
```
37+
this.log.error(`Error getting system config for ${service.name}:`, error);
38+
```
2639
> this.log.debug
2740
28-
Messages are highlighted in gray
41+
Messages are highlighted in gray<br>
2942
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);
46+
```

0 commit comments

Comments
 (0)