Skip to content

Commit

Permalink
Scaffold: Normalize repository
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 10, 2018
1 parent ffb0944 commit cade00d
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 21 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
sudo: false
language: node_js
node_js:
- '9'
- '10'
- '8'
- '6'
- '4'
- '0.12'
- '0.10'
after_script:
- npm run coveralls
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 Blaine Bublitz
Copyright (c) 2014, 2015, 2018 Blaine Bublitz <blaine.bublitz@gmail.com> and Eric Schoffstall <yo@contra.io>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<p align="center">
<a href="http://gulpjs.com">
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
</a>
</p>

# glogg

[![Travis Build Status](https://img.shields.io/travis/js-cli/glogg/master.svg?label=travis&style=flat-square)](https://travis-ci.org/js-cli/glogg)
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]

Global logging utility
Global logging utility.

## Usage

Expand Down Expand Up @@ -90,3 +96,19 @@ the logger methods.
## License

MIT

[downloads-image]: http://img.shields.io/npm/dm/glogg.svg
[npm-url]: https://www.npmjs.com/package/glogg
[npm-image]: http://img.shields.io/npm/v/glogg.svg

[travis-url]: https://travis-ci.org/gulpjs/glogg
[travis-image]: http://img.shields.io/travis/gulpjs/glogg.svg?label=travis-ci

[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glogg
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glogg.svg?label=appveyor

[coveralls-url]: https://coveralls.io/r/gulpjs/glogg
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/glogg/master.svg

[gitter-url]: https://gitter.im/gulpjs/gulp
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg
26 changes: 26 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# http://www.appveyor.com/docs/appveyor-yml
# http://www.appveyor.com/docs/lang/nodejs-iojs

environment:
matrix:
# node.js
- nodejs_version: "0.10"
- nodejs_version: "0.12"
- nodejs_version: "4"
- nodejs_version: "6"
- nodejs_version: "8"
- nodejs_version: "10"

install:
- ps: Install-Product node $env:nodejs_version
- npm install

test_script:
- node --version
- npm --version
- cmd: npm test

build: off

# build version format
version: "{build}"
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ var levels = [
'debug',
'info',
'warn',
'error'
'error',
];

function getLogger(namespace) {
var logger = sparkles(namespace);

levels.forEach(function(level){
levels.forEach(function(level) {
logger[level] = makeLogLevel(logger, level);
});

return logger;
}

function makeLogLevel(self, level) {
return function(msg){
return function(msg) {
if (typeof msg === 'string') {
msg = format.apply(null, arguments);
}
Expand Down
20 changes: 13 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"name": "glogg",
"version": "1.0.1",
"description": "Global logging utility",
"author": "Blaine Bublitz <blaine@iceddev.com> (http://iceddev.com/)",
"contributors": [],
"repository": "js-cli/glogg",
"author": "Gulp Team <team@gulpjs.com> (http://gulpjs.com/)",
"contributors": [
"Blaine Bublitz <blaine.bublitz@gmail.com>"
],
"repository": "gulpjs/glogg",
"license": "MIT",
"engines": {
"node": ">= 0.10"
Expand All @@ -17,16 +19,20 @@
"scripts": {
"lint": "eslint .",
"pretest": "npm run lint",
"test": "mocha --async-only"
"test": "mocha --async-only",
"cover": "istanbul cover _mocha --report lcovonly",
"coveralls": "npm run cover && istanbul-coveralls"
},
"dependencies": {
"sparkles": "^1.0.0"
},
"devDependencies": {
"eslint": "^1.7.3",
"eslint-config-gulp": "^2.1.0",
"eslint": "^2.13.0",
"eslint-config-gulp": "^3.0.1",
"expect": "^1.20.2",
"mocha": "^2.5.3"
"istanbul": "^0.4.3",
"istanbul-coveralls": "^1.0.3",
"mocha": "^3.5.3"
},
"keywords": [
"global",
Expand Down
6 changes: 6 additions & 0 deletions test/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "gulp/test",
"rules": {
"no-console": 0
}
}
14 changes: 7 additions & 7 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('glogg', function() {
});

it('emits a debug event when debug method is called', function(done) {
logger.on('debug', function(msg){
logger.on('debug', function(msg) {
expect(msg).toEqual('test');
done();
});
Expand All @@ -28,7 +28,7 @@ describe('glogg', function() {
});

it('emits a info event when info method is called', function(done) {
logger.on('info', function(msg){
logger.on('info', function(msg) {
expect(msg).toEqual('test');
done();
});
Expand All @@ -37,7 +37,7 @@ describe('glogg', function() {
});

it('emits a warn event when warn method is called', function(done) {
logger.on('warn', function(msg){
logger.on('warn', function(msg) {
expect(msg).toEqual('test');
done();
});
Expand All @@ -46,7 +46,7 @@ describe('glogg', function() {
});

it('emits a error event when error method is called', function(done) {
logger.on('error', function(msg){
logger.on('error', function(msg) {
expect(msg).toEqual('test');
done();
});
Expand All @@ -55,7 +55,7 @@ describe('glogg', function() {
});

it('formats a string message with util.format syntax', function(done) {
logger.on('debug', function(msg){
logger.on('debug', function(msg) {
expect(msg).toEqual('test something');
done();
});
Expand All @@ -66,7 +66,7 @@ describe('glogg', function() {
it('does not format a non-string message', function(done) {
var expected = { test: 'something' };

logger.on('debug', function(msg){
logger.on('debug', function(msg) {
expect(msg).toEqual(expected);
done();
});
Expand All @@ -77,7 +77,7 @@ describe('glogg', function() {
it('allows you to "destructure" the individual log-level functions', function(done) {
var debug = logger.debug;

logger.on('debug', function(msg){
logger.on('debug', function(msg) {
expect(msg).toEqual('test');
done();
});
Expand Down

0 comments on commit cade00d

Please # to comment.