UNPKG

record-desktop

Version:

Record gifs and take screenshots on linux, built with electron.

23 lines (19 loc) 553 B
import winston from 'winston'; import notifier from 'node-notifier'; import { getHasNotifications } from './config'; const logger = new (winston.Logger)({ transports: [ new (winston.transports.Console)(), new (winston.transports.File)({ filename: '/tmp/record-desktop' }) ] }); export const log = logger.info.bind(logger); export const notify = (text, err) => { log(text, err || ''); if (getHasNotifications()) { notifier.notify({ title: 'record-desktop', message: text + (err ? ' ' + err.message : '') }); } };