Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hexojs/hexo-log
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0339d12c9749f850c79d33ae83b3671e9b97abb2
Choose a base ref
...
head repository: hexojs/hexo-log
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 117b51cc174c8f4290367e11b05a99f52fecb29c
Choose a head ref
Loading
Showing with 8,581 additions and 155 deletions.
  1. +11 −0 .github/dependabot.yml
  2. +28 −0 .github/release-drafter.yml
  3. +27 −0 .github/workflows/linter.yml
  4. +14 −0 .github/workflows/release-drafter.yml
  5. +58 −0 .github/workflows/tester.yml
  6. +1 −1 .gitignore
  7. +0 −4 .jscsrc
  8. +0 −8 .npmignore
  9. +0 −21 .travis.yml
  10. +8 −9 README.md
  11. +74 −56 lib/log.js
  12. +8,042 −0 package-lock.json
  13. +20 −18 package.json
  14. +1 −0 test/.mocharc.yml
  15. +297 −37 test/index.js
  16. +0 −1 test/mocha.opts
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 20
ignore:
- dependency-name: sinon
versions:
- 10.0.0
28 changes: 28 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
categories:
- title: 'Breaking change'
labels:
- 'Breaking Change'
- title: 'Features'
labels:
- 'feature'
- 'enhancement'
- title: 'Fixes'
labels:
- 'bug'
- title: 'Performance'
labels:
- 'performance'
- '#perfmatters'
- title: 'Dependencies'
labels:
- 'dependencies'
- title: 'Refactor'
labels:
- 'refactor'
change-template: '- $TITLE @$AUTHOR [#$NUMBER]'
template: |
## Changes
$CHANGES
27 changes: 27 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Linter

on: [push, pull_request]

jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: '12.x'
- name: Cache NPM dependencies
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.OS }}-npm-cache
restore-keys: |
${{ runner.OS }}-npm-cache
- name: Install Dependencies
run: npm install
- name: Lint
run: |
npm run eslint
env:
CI: true
14 changes: 14 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Release Drafter

on:
push:
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58 changes: 58 additions & 0 deletions .github/workflows/tester.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Tester

on: [push, pull_request]

jobs:
tester:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: ['12.x', '14.x', '16.x']
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache NPM dependencies
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-npm-cache
restore-keys: ${{ runner.os }}-npm-cache
- name: Install Dependencies
run: npm install
- name: Test
run: npm run test
env:
CI: true
coverage:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: ['12.x']
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache NPM dependencies
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-npm-cache
restore-keys: ${{ runner.os }}-npm-cache
- name: Install Dependencies
run: npm install
- name: Coverage
run: npm run test-cov
env:
CI: true
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -3,4 +3,4 @@ node_modules/
tmp/
*.log
.idea/
coverage/
.nyc_output/
4 changes: 0 additions & 4 deletions .jscsrc

This file was deleted.

8 changes: 0 additions & 8 deletions .npmignore

This file was deleted.

21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# hexo-log

[![Build Status](https://travis-ci.org/hexojs/hexo-log.svg?branch=master)](https://travis-ci.org/hexojs/hexo-log) [![NPM version](https://badge.fury.io/js/hexo-log.svg)](http://badge.fury.io/js/hexo-log) [![Coverage Status](https://coveralls.io/repos/hexojs/hexo-log/badge.svg?branch=master)](https://coveralls.io/r/hexojs/hexo-log?branch=master)
[![Build Status](https://github.com/hexojs/hexo-log/workflows/Tester/badge.svg?branch=master)](https://github.com/hexojs/hexo-log/actions?query=workflow%3ATester)
[![NPM version](https://badge.fury.io/js/hexo-log.svg)](https://www.npmjs.com/package/hexo-log)
[![Coverage Status](https://coveralls.io/repos/hexojs/hexo-log/badge.svg?branch=master)](https://coveralls.io/r/hexojs/hexo-log?branch=master)

Logger for Hexo, based on [bunyan] with better console output.
Logger for Hexo.

## Installation

@@ -13,22 +15,19 @@ $ npm install hexo-log --save
## Usage

``` js
var log = require('hexo-log')({
const log = require('hexo-log')({
debug: false,
silent: false
});
})

log.info('Hello world');
```

Option | Description | Default
--- | --- | ---
`debug` | Display debug message and save log to `debug.log` file. | `false`
`silent` | Don't display message in console. | `false`
`name` | Name | `hexo`
`debug` | Display debug message. | `false`
`silent` | Don't display any message in console. | `false`

## License

MIT

[bunyan]: https://github.com/trentm/node-bunyan
Loading