homebridge-eveatmo
Version:
Homebridge plugin which adds a Netatmo weatherstation as HomeKit device and tries to act like Elgato Eve Room/Weather
29 lines (25 loc) • 563 B
JavaScript
;
function createLog() {
const log = () => {};
log.debug = () => {};
log.info = () => {};
log.warn = () => {};
log.error = () => {};
return log;
}
function createRecordingLog() {
const calls = [];
function record(level) {
return (...args) => {
calls.push({ level, args });
};
}
const log = record('log');
log.debug = record('debug');
log.info = record('info');
log.warn = record('warn');
log.error = record('error');
log.calls = calls;
return log;
}
module.exports = { createLog, createRecordingLog };