Gathering detailed insights and metrics for logatim
Gathering detailed insights and metrics for logatim
Gathering detailed insights and metrics for logatim
Gathering detailed insights and metrics for logatim
npm install logatim
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
192 Stars
72 Commits
3 Forks
5 Watching
3 Branches
4 Contributors
Updated on 06 Nov 2024
JavaScript (98.94%)
HTML (1.06%)
Cumulative downloads
Total Downloads
Last day
0%
172
Compared to previous day
Last week
27%
2,604
Compared to previous week
Last month
3,424.8%
14,346
Compared to previous month
Last year
405.3%
16,085
Compared to previous year
Finally you can use the same logger for the server and client side of your applications. Log for developers using colors, underlines, etc. in order to transform the terminal in an authentic debugger machine. And log for production managing exactly what have and what have not to be outputted.
If you're excited about this and want to try it right now you have 2 options:
I've been coding for a long time and I've always feel that we need a better approach to the logging issue. I've researched a lot about the available logger modules and I've even run a questionary about this topic. After this inquiry I think that the most suitable logger should combines these six elemental features:
Choose one of the following options:
npm install logatim --save
dist
folder the stand-alone specification which fits better for you: var
, commonjs
, umd
or amd
. Note that the installation via npm
uses the umd pattern so should work in all the environments.logatim.green.bold.info('super sexy')
console
object so you'll keep the stack trace and line numbers.var
directly.npm
(Only the versions which had been introduced the console colors support. We cannot do magic... yet.)
The logatim API is tend to be extremely minimal and human-like. It has two different kind of options: the styling and the leveling ones. Logatim consists in:
1const logatim = require('logatim') 2 3logatim.blue.bgYellow.bold.info("It's like reading english") 4 5// and the next print is completely independent; zero memories 6logatim.green.info('No background color nor bold here') 7 8// you can concat different styles 9logatim.red('R').green('G').blue('B').info() 10 11// also, of course you can print without any style 12logatim.info("I'm a boring log") 13
The colors available are: black, red, green, yellow, blue, magenta, cyan, white, gray and grey (fixing humans).
The background colors available are: bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray and bgGrey.
The sets available are: bold, dim, italic, underline, blink, inverse, hidden, strikethrough (Almost no browser supports blink and inverse is not supported when printing on the browser's console).
console
native logging methods (aka levels):1const logatim = require('logatim') 2 3// sorted from bottom in the bubbling logging scale 4logatim.trace('Good for track pathways') 5logatim.info('Good while developing')
Note that the log methods are end-like functions. Therefore they are not returning a Logatim instance, so they're not chainable.
1const logatim = require('logatim') 2 3logatim.getLevel() // by default is WARN 4logatim.debug("I won't be printed") // because debug is lower than warn 5logatim.setLevel('info') 6logatim.debug("I'll be printed") // because debug is greater than info
console
object (I'm staring at you IE) it will silent fallback to the safest print possible.Please feel free to raise issues, make contributions or suggestions/requests. Remember that we follow standard code style and the continous integration pattern so any pull request should run the tests first.
1git clone https://github.com/edravis/logatim.git 2cd logatim 3npm install 4# edit logatim 5 6# when done 7npm test 8npm run build 9# send the PR, yaaay!
If you feel that the force is strong in Logatim keep an eye to the todo list and maybe you find something you're willing to make ;)
Logatim comes from a combination of the words log and verbatim. The first one is obviously referred to the cutten trunk... lol no, it's for the coding logfiles. And the second one is a Latin term that can be translated as word for word. So, the term Logatim could be loosely translated as log for log.
The code is available under the ISC license.
Handcrafted by @sospedra_r / sospedra.me.
With contributions from:
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More