"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs-extra");
const os = require("os");
const path = require("path");
const main_1 = require("./main");
const configPath = path.resolve(os.homedir(), '.homebridge', 'config.json');
const homebridgeConfig = fs.readJsonSync(configPath);
const pluginConfig = homebridgeConfig.platforms.find(x => x.platform === 'google-smarthome');
class Log {
    constructor(prefix) {
        this.prefix = prefix;
    }
    debug(msg) {
        this.log('DEBUG', msg);
    }
    info(msg) {
        this.log('INFO', msg);
    }
    warn(msg) {
        this.log('WARN', msg);
    }
    error(msg) {
        this.log('ERROR', msg);
    }
    log(level, msg) {
        const date = new Date();
        const output = `[${level}] [${date.toLocaleString()}] [${this.prefix}]`;
        console.log(output, msg);
    }
}
new main_1.Plugin(new Log('Google Smart Home'), pluginConfig, homebridgeConfig);
//# sourceMappingURL=dev.js.map