Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
binding debug logging of hap-nodejs to pimatic logger
Browse files Browse the repository at this point in the history
  • Loading branch information
michbeck100 committed Jan 2, 2016
1 parent c2726ce commit 0bfc894
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions hap.coffee
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# activate HAP-NodeJS logging
process.env['DEBUG'] = 'HAPServer,Accessory,EventedHttpServer'

module.exports = (env) =>

Expand All @@ -22,6 +24,11 @@ module.exports = (env) =>
Characteristic = hap.Characteristic
uuid = require ('hap-nodejs/lib/util/uuid')

# bind hap-nodejs' debug logging to pimatic logger
Debug = require ('hap-nodejs/node_modules/debug')
Debug.log = env.logger.debug.bind(env.logger)
Debug.formatArgs = () => arguments

class HapPlugin extends env.plugins.Plugin

init: (app, @framework, @config) =>
Expand Down

0 comments on commit 0bfc894

Please sign in to comment.