Giter VIP home page Giter VIP logo

hexo-log's Introduction

hexo-log

Build Status NPM version Coverage Status

Logger for Hexo.

Installation

$ npm install hexo-log --save

Usage

// v3.x.x
const log = require('hexo-log')({
  debug: false,
  silent: false
});
log.info('Hello world');

// v4.x.x
const log = require('hexo-log').default({
  debug: false,
  silent: false
});
log.info('Hello world');

// v4.x.x (ES Module)
import { logger } from 'hexo-log';

const log = logger({
  debug: false,
  silent: false
});
log.info('Hello world');
Option Description Default
debug Display debug message. false
silent Don't display any message in console. false

License

MIT

hexo-log's People

Contributors

curbengh avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar dimaslanjaka avatar jlhwung avatar leesei avatar noahdragon avatar segayuu avatar stevenjoezhang avatar sukkaw avatar tomap avatar tommy351 avatar yoshinorin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hexo-log's Issues

Publish 2.0.0

cc @hexojs/core

It is ready to publish a 2.0.0 version.

Changelog:

## Changes

- refactor: completely rewrite the logger @SukkaW [#34]
- chore: add release-drafter @YoshinoriN [#35]
- docs(readme): add npmjs link @curbengh [#16]
- chore: specify files to publish @curbengh [#15]
- test: replace istanbul with nyc @curbengh [#14]

## Dependencies

- chore(deps-dev): bump mocha from 7.2.0 to 8.0.1 @dependabot-preview [#38]
- chore(deps-dev): bump sinon from 8.1.1 to 9.0.2 @dependabot-preview [#33]
- chore(deps-dev): bump eslint from 6.8.0 to 7.1.0 @dependabot-preview [#37]
- chore(deps): bump chalk from 3.0.0 to 4.0.0 @dependabot-preview [#32]
- chore(deps-dev): bump rewire from 4.0.1 to 5.0.0 @dependabot-preview [#30]
- Bump nyc from 14.1.1 to 15.0.0 @dependabot-preview [#22]
- Bump eslint-config-hexo from 3.0.0 to 4.0.0 @dependabot-preview [#21]

`%s` is not replaced correctly in [email protected]

Test script:

require('hexo-log')().fatal({'Error': 'Error'}, 'Rendered: %s', 'filename')

With [email protected], the output is

FATAL Rendered: filename

With [email protected], the output is

FATAL { Error: 'Error' } Rendered: %s filename

The behaviour is changed in #34

See also https://github.com/hexojs/hexo/blob/eef2eac874b5118cae73fcdb4acba3a6c744f2b5/lib/hexo/index.js#L468-L472
https://github.com/hexojs/hexo-bunyan/blob/b2752b1eaf590e5620b17e09349860a4a862c597/lib/bunyan.js#L937-L970

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.