A wrapper of winston. For simple usage.

Usage no npm install needed!

<script type="module">
  import adoyleMeWinstonLogger from 'https://cdn.skypack.dev/@adoyle.me/winston-logger';



Node Version Npm Package Version License NodeJS Package Dependencies Build Status Code Climate Test Coverage

A wrapper of winston. For simple usage.



npm install -S @adoyle.me/winston-logger


import Factory from '@adoyle.me/winston-logger';
// const Factory = require('@adoyle.me/winston-logger');

const Logger = Factory.new();

// const Logger = Factory.new({
//     files: [
//         {
//             level: 'error',
//             filename: 'logs/error.log',
//         },
//         {
//             level: 'debug',
//             filename: 'logs/all.log',
//         },
//     ],
//     console: false,
// });

const logger = Logger.create();
// const logger = Logger.create({label: 'xxx'});
// const logger = Logger.create({label: 'xxx', depth: null});

logger.info('hello %s', 'world');
logger.error('error= %O', {message: 'failed'});


The versioning follows the rules of SemVer 2.0.0.

BUT, anything may have BREAKING CHANGES at ANY TIME when major version is zero (0.y.z), which is for initial development and the public API should be considered unstable.

When major version is zero, You should save it with prefix ~.

For more information on SemVer, please visit http://semver.org/.

Copyright and License

Copyright (c) 2019 ADoyle. The project is licensed under the Apache License Version 2.0.

See the LICENSE file for the specific language governing permissions and limitations under the License.

See the NOTICE file distributed with this work for additional information regarding copyright ownership.