Skip to content

Commit

Permalink
Merge pull request #185 from zoic21/patch-1
Browse files Browse the repository at this point in the history
Fix issue if this plugin is used outside of jeedom
  • Loading branch information
NebzHB authored Oct 31, 2023
2 parents 56d9acd + e8e304f commit 5e35d5a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'use strict';

let Access, Accessory, Service, Characteristic, AdaptiveLightingController, UUIDGen;
const fs = require('fs');
const inherits = require('util').inherits;
const myLogger = require('./lib/myLogger').myLogger;
const debug = {};
Expand Down Expand Up @@ -59,7 +60,11 @@ function JeedomPlatform(logger, config, api) {
DEV_DEBUG = true;
}
this.debugLevel = config.debugLevel || debug.ERROR;
this.log = myLogger.createMyLogger(this.debugLevel,logger,api.user.storagePath()+'/../../../../log/');
let logPath = api.user.storagePath()+'/../../../../log/';
if (!fs.existsSync(logPath)) {
logPath = '/tmp/';
}
this.log = myLogger.createMyLogger(this.debugLevel,logger,logPath);
this.log('debugLevel:'+this.debugLevel);
this.myPlugin = config.myPlugin;
this.adaptiveEnabled = config.adaptiveEnabled;
Expand Down

0 comments on commit 5e35d5a

Please sign in to comment.