2.0.0 • Published 11 months ago

fancy-log v2.0.0

Weekly downloads
2,611,840
License
MIT
Repository
github
Last release
11 months ago

fancy-log

NPM version Downloads Build Status Coveralls Status

Log things, prefixed with a timestamp.

Usage

var log = require('fancy-log');

log('a message');
// [16:27:02] a message

log.error('oh no!');
// [16:27:02] oh no!

API

log(msg...)

Logs the message as if you called console.log but prefixes the output with the current time in HH:mm:ss format.

log.error(msg...)

Logs the message as if you called console.error but prefixes the output with the current time in HH:mm:ss format.

log.warn(msg...)

Logs the message as if you called console.warn but prefixes the output with the current time in HH:mm:ss format.

log.info(msg...)

Logs the message as if you called console.info but prefixes the output with the current time in HH:mm:ss format.

log.dir(msg...)

Logs the message as if you called console.dir but prefixes the output with the current time in HH:mm:ss format.

Styling

If the terminal that you are logging to supports colors, the timestamp will be formatted as though it were a Date being formatted by util.inspect(). This means that it will be formatted as magenta by default but can be adjusted following node's Customizing util.inspect colors documentation.

For example, this will cause the logged timestamps (and other dates) to display in red:

var util = require('util');

util.inspect.styles.date = 'red';

License

MIT

gulp-cligulp-util@sooha/clialgotia-test-packagemegereact-native-bluetooth2killi8n-react-native-fast-imagehandywebpackcss-module-typescript-definition-creator-pluginrn-send-smsimage-grayscale@appirio/dxeris-clusterssimple-fancy-loggulp-links-state-replacerr@acanto/workflow-laravel-frontendavantiskyblreact-native-template-rfbaseciic-sonarqube-scanner@anho/circleci-orb-toolsloafsaccra-uglifyvinus3vinus4@timstrasser/log-essentialsairscanairscan-examplejoshtestingreact-native-esc-pos-sahaab@borisovart/atol-kkt-modulessh-deploy-webpack-pluginmulti-deploythunderbirddeneme323112jinniaqua-client@ntt_app/react-native-custom-notification@spothero/acegui-jvale-dawn-toolsseed-cli-toolsgulp-abraiareact-native-covid-sdkbti-less-compiler@wctools/polymer-project-builderaixyreact-native-thanh-toast-library@thanhnguyen14797/react-native-thanh-toast-library@whalecloud/fish-cli@webtides/tasks@whitetrefoil/unistore-act@whitetrefoil/unistore-bind@wok-cli/core@whitetrefoil/check-dependencies@whitetrefoil/debug-server@whitetrefoil/koa-http-proxy@whitetrefoil/pac-generator-server@whitetrefoil/pushbullet-proxy@wiajs/cli@zadkiel/gulp-feed@zebrajaeger/gulp-eslint@zebrajaeger/gulp-scale-images@zebrajaeger/gulp-scale-images-resize-jimp@zebrajaeger/gulp-scale-images-resize-sharp@ziggurat/isimud-fs@ziggurat/isimud-logging@ziggurat/nabu@ziggurat/tashmetu-loggingadd-dist-headeraifyaimi-deployairkitaisi-vueaisi-vue-testalivaisino-ui@xyo-network/web-base-bootstrap@yakamara/gulp-tasksahvnai-vueag-gulp-cli-4aether-sharderzoos-mp-gulp-cdnifyduorjsgulp-simplepanqibaoreact-native-printer-brothersrn-pdf-reader-offlinealuminum-capsule@feizheng/next-log@felipesimmi/react-native-datalogic-module@fabiospampinato/statico@fatchan/gulp-pug@ffaubert/gulp-htmlhint@ffaubert/gulp-stylelint@feq/element-theme-generator@feq/gulp-css-min@feq/gulp-css-wrap@etnetera/sonarqube-scanner@edunse/deployer
2.0.0

11 months ago

1.3.3

4 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

6 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago