-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implemented logging with changable level
- Loading branch information
Stephan van Rooij
committed
Mar 26, 2020
1 parent
866ef43
commit e668039
Showing
10 changed files
with
127 additions
and
35 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import {SonosToMqtt} from './sonos-to-mqtt' | ||
import {ConfigLoader} from './config' | ||
import { StaticLogger } from './static-logger' | ||
|
||
const sonosToMqtt = new SonosToMqtt(ConfigLoader.LoadConfig()) | ||
|
||
sonosToMqtt | ||
.start() | ||
.then(success => { | ||
if(success) { | ||
console.log('Sonos2Mqtt started') | ||
process.on('SIGINT', async () => { | ||
console.log('Shutting down listeners, please wait') | ||
StaticLogger.Default().info('Shutdown sonos2mqtt, please wait.') | ||
sonosToMqtt.stop() | ||
setTimeout(() => { process.exit(0) }, 800) | ||
}) | ||
} | ||
}) | ||
.catch(err => { | ||
console.error('Sonos2Mqtt failed to start', err) | ||
StaticLogger.Default().fatal(err, 'Error starting sonos2mqtt') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.