LogoDuyệtSr. Data Engineer
HomeAboutPhotosInsightsCV

Footer

Logo

Resources

  • Rust Tiếng Việt
  • /archives
  • /series
  • /tags
  • Status

me@duyet.net

  • About
  • LinkedIn
  • Resume
  • Projects

© 2026 duyet.net | Sr. Data Engineer | 2026-02-27

Signale - Hackable console logger for Nodejs

Note: This post is over 8 years old. The information may be outdated.

Signale là một thư viện thay thế console logger trong Nodejs, cho kết quả đẹp, sexy hơn và nhiều chức năng.

Cài đặt

npm install signale

Import và sử dụng như console.*

const signale = require('signale')

signale.success('Operation successful')
signale.debug('Hello', 'from', 'L59')
signale.pending('Write release notes for %s', '1.2.0')
signale.fatal(new Error('Unable to acquire lock'))
signale.watch('Recursively watching build directory...')
signale.complete({
  prefix: '[task]',
  message: 'Fix issue #59',
  suffix: '(@klauscfhq)',
})

Custom Loggers

Bạn có thể custom rất nhiều cho logger, bao gồm định nghĩa thêm phương thức log mới:

const { Signale } = require('signale')

const options = {
  disabled: false,
  interactive: false,
  stream: process.stdout,
  scope: 'custom',
  types: {
    remind: {
      badge: '**',
      color: 'yellow',
      label: 'reminder',
    },
    santa: {
      badge: '🎅',
      color: 'red',
      label: 'santa',
    },
  },
}

const custom = new Signale(options)
custom.remind('Improve documentation.')
custom.santa('Hoho! You have an unused variable on L45.')

Xem thêm chi tiết và cấu hình tham số tại đây: https://github.com/klauscfhq/signale

Jul 19, 2018·8 years ago
|Web|
JavascriptNode.js
|Edit|

Related Posts

Sublime Text Plugin nào cho lập trình viên Node.js

Hôm nay mình sẽ giới thiệu 1 số plugin cần có để lập trình Node.js trên Sublime.

Jul 20, 2016·10 years ago
Read more

Javascript Shorthands Tips

These Javascript shorthand tips will make your code look more cool and clean.

Oct 20, 2019·6 years ago
Read more

5 bí quyết viết JS conditionals tốt hơn

Trong Javascript, chúng ta phải sử dụng nhiều loại lệnh điều kiện (if ... else ...) khác nhau, sau đây là 5 bí quyết để viết lệnh if else nhanh hơn và chuyên nghiệp hơn.

Sep 20, 2018·7 years ago
Read more

Gio.js - 3D Globe Data Visualization

Gio.js là thư viện nguồn mở để visualization 3D globe, xây dựng dựa trên thư viện **Three.js**. Gio.js cực kỳ dễ sử dụng và dễ customize.

Jul 1, 2018·8 years ago
Read more
On this page
  • Cài đặt
  • Custom Loggers
On this page
  • Cài đặt
  • Custom Loggers