
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
examplify-log
Advanced tools
Just a very simple logging module for your Electron or NW.js application. No dependencies. No complicated configuration. Just require and use. Also it can be used without Electron.
By default it writes logs to the following locations:
~/.config/<app name>/log.log
~/Library/Logs/<app name>/log.log
%USERPROFILE%\AppData\Roaming\<app name>\log.log
Install with npm:
npm install electron-log
var log = require('electron-log');
log.info('Hello, log');
Transport is a simple function which requires an object which describes a message. By default, two transports are active: console and file. The file path is dependent on current platform.
log.transports.file = false;
log.transports.console = false;
log.transports.console = function(msg) {
console.log(`[${msg.date.toLocaleTimeString()} ${msg.level}] ${msg.text}`);
};
// Log level
log.transports.console.level = 'warn';
/**
* Set output format template. Available variables:
* Main: {level}, {text}
* Date: {y},{m},{d},{h},{i},{s},{ms}
*/
log.transports.console.format = '{h}:{i}:{s}:{ms} {text}';
// Set a function which formats output
log.transports.console.format = (msg) => msg.text;
// Same as for console transport
log.transports.file.level = 'warn';
log.transports.file.format = '{h}:{i}:{s}:{ms} {text}';
// Set maximum log size in bytes. When it exceeds, old log will be saved
// as log.old.log file
log.transports.file.maxSize = 5 * 1024 * 1024;
// Write to this file, must be set before first logging
log.transports.file.file = __dirname + '/log.txt';
// fs.createWriteStream options, must be set before first logging
log.transports.file.streamConfig = { flags: 'w' };
// set existed file stream
log.transports.file.stream = fs.createWriteStream('log.txt');
By default, file transport reads a productName or name property from package.json to
determine a log path like ~/.config/<app name>/log.log
.
If you have no package.json or you want to specify another ,
just set the appName property:
log.appName = 'test';
1.3.0
1.2.0
1.0.16
Licensed under MIT.
FAQs
Just a very simple logging module for Examplify
The npm package examplify-log receives a total of 4 weekly downloads. As such, examplify-log popularity was classified as not popular.
We found that examplify-log demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.