Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Loggir is created to help fellow developers have a simple yet useful logging tool.
npm i --save loggir
Simply create a new instance of Loggir and start logging!
const Loggir = require("./index");
const logger = new Loggir({
name: "api",
path: "logs",
fileName: "myLogs",
format: "log",
separate: true,
timezone: "Europe/London",
log: false
});
(async () => {
await logger.error("Some error"); // [Europe/London 1/25/2020, 01:21:57] [api] [ERROR] "Some error"
await logger.info("Some info"); // [Europe/London 1/25/2020, 01:21:57] [api] [INFO] "Some info"
await logger.warn("Some warn"); // [Europe/London 1/25/2020, 01:21:57] [api] [WARN] "Some warn"
})();
Logs an error with given text
Logs an info with given text
Logs a warn with given text
This is for you to know which logger this is.
Example: { name: 'api' }
Directory path to save logs in, prior to where loggir is launching from.
Example: { path: 'logs' }
Provide this to save your logs inside a file with the given name, not providing will result in an auto-generated name with month-day-year.format
file.
Example: { fileName: 'mylog' }
Don't like to save your logs in .log? No problem, just provide the format (extension) and everything is set up!
Example: { format: 'txt' }
- defaults to log
Tired of looking for errors in the same file as infos and warnings? We got you! just provide separate as true
and loggir will log for you in separate files!
Example: {separate: true}
- defaults to false
If you would like to get logs in a different timezone from your server's, just provide your desired timezone. (find yours: https://momentjs.com/timezone/)
Example: {timezone: 'Europe/London'}
- defaults to local
You probably should set this to false
, but if you are having troubles with loggir or simply want to get some fancy console.log 's set log to true.
Example: {log: false}
- defaults to true
FAQs
Simple logger for your application
The npm package loggir receives a total of 0 weekly downloads. As such, loggir popularity was classified as not popular.
We found that loggir 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.