Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(refacto): Add appenders, layouts and multiple loggings output
- Loading branch information
Showing
125 changed files
with
27,495 additions
and
1,283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"include": [ | ||
"src/**/*.js" | ||
], | ||
"exclude": [ | ||
"**/index.ts", | ||
"**/index.js", | ||
"**/interfaces/*.js" | ||
], | ||
"reporter": [ | ||
"lcov", | ||
"text-summary" | ||
], | ||
"extension": [ | ||
".ts" | ||
], | ||
"check-coverage": true, | ||
"lines": 93, | ||
"statements": 92, | ||
"functions": 86, | ||
"branches": 78, | ||
"all": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 Romain Lenzotti | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
## Status | ||
**READY/IN DEVELOPMENT/HOLD** | ||
|
||
## Migrations | ||
YES | NO | ||
|
||
## Description | ||
A few sentences describing the overall goals of the pull request's commits. | ||
|
||
## Usage example | ||
Example to use your feature and to improve the documentation after merging your PR: | ||
``` | ||
import {} from "ts-express-decorators"; | ||
``` | ||
|
||
## Related PRs | ||
List related PRs against other branches: | ||
|
||
branch | PR | ||
------ | ------ | ||
other_pr_production | [link]() | ||
other_pr_master | [link]() | ||
|
||
|
||
## Todos | ||
- [ ] Tests | ||
- [ ] Documentation | ||
|
||
|
||
## Deploy Notes | ||
Notes regarding deployment the contained body of work. These should note any | ||
db migrations, etc. | ||
|
||
## Impacted Areas in Application | ||
List general components of the application that this PR will affect: | ||
|
||
* |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# TsLogDebug | ||
|
||
[![Build Status](https://travis-ci.org/Romakita/ts-log-debug.svg?branch=master)](https://travis-ci.org/Romakita/ts-log-debug) | ||
[![Coverage Status](https://coveralls.io/repos/github/Romakita/ts-log-debug/badge.svg?branch=master)](https://coveralls.io/github/Romakita/ts-log-debug?branch=master) | ||
[![TypeScript](https://badges.frapsoft.com/typescript/love/typescript.svg?v=100)](https://github.com/ellerbrock/typescript-badges/) | ||
[![Package Quality](http://npm.packagequality.com/shield/ts-log-debug.png)](http://packagequality.com/#?package=ts-log-debug) | ||
[![npm version](https://badge.fury.io/js/ts-log-debug.svg)](https://badge.fury.io/js/ts-log-debug) | ||
[![Dependencies](https://david-dm.org/romakita/ts-log-debug.svg)](https://david-dm.org/romakita/ts-log-debug#info=dependencies) | ||
[![img](https://david-dm.org/romakita/ts-log-debug/dev-status.svg)](https://david-dm.org/romakita/ts-log-debug/#info=devDependencies) | ||
[![img](https://david-dm.org/romakita/ts-log-debug/peer-status.svg)](https://david-dm.org/romakita/ts-log-debug/#info=peerDependenciess) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/romakita/ts-log-debug/badge.svg)](https://snyk.io/test/github/romakita/ts-express-decorators) | ||
|
||
> A multi chanel logger written in TypeScript. | ||
## Features | ||
|
||
* Colored console logging to stdout or stderr, | ||
* File appender, with configurable log rolling based on file size or date | ||
* Configurable log message layout/patterns | ||
* Different log levels for different log categories (make some parts of your app log as DEBUG, others only ERRORS, etc.) | ||
|
||
Please refer to the [documentation](http://ts-log-debug.github.io) for more details. | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install -g typescript | ||
npm install ts-log-debug | ||
``` | ||
|
||
## Breaking change 3.x | ||
|
||
Since v3.x, the logger is completely rewritten to support new features. This new version is inspired by the excellent project [log4js](https://github.com/nomiddlename/log4js-node/). | ||
|
||
## Quick start | ||
|
||
Minimalist version: | ||
|
||
```typescript | ||
import {$log} from "ts-log-debug"; | ||
$log.level = "debug"; | ||
$log.name = "APP"; | ||
|
||
$log.debug("Some debug messages"); | ||
``` | ||
Will be procude the following log output: | ||
``` | ||
[2017-06-17 11:43:37.987] [DEBUG] [APP] - Some debug messages | ||
``` | ||
|
||
Create your custom logger: | ||
```typescript | ||
import {Logger} from "ts-log-debug"; | ||
|
||
const logger = new Logger("loggerName"); | ||
logger.appenders | ||
.push({ | ||
type: "stdout", | ||
levels: ["debug", "info", "trace"] | ||
}) | ||
.push({ | ||
type: "stderr", | ||
levels: ["fatal", "error", "warn"], | ||
layout: { | ||
type: "pattern", | ||
pattern: "%d %p %c %X{user} %m%n" | ||
} | ||
}) | ||
.push({ | ||
type: "file", | ||
filename: `${__dirname}/app.log`, | ||
layout:{ | ||
type: "json", | ||
separator: "," | ||
} | ||
}) | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!-- _coverpage.md --> | ||
|
||
# TsLogDebug <small>3.0</small> | ||
|
||
> A multi chanel logger written in TypeScript. | ||
* Colored console logging, | ||
* Configurable log message layout/patterns. | ||
|
||
[GitHub](https://github.com/Romakita/ts-log-debug/) | ||
[Get Started](#tslogdebug) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
- [Getting Started](getting-started.md) | ||
|
||
- Appenders | ||
- [Configuration](appenders.md) | ||
|
||
- Layouts | ||
- [Configuration](layouts.md) | ||
- Built-in layouts | ||
- [Basic](layouts/basic.md) | ||
- [Colored](layouts/colored.md) | ||
- [Dummy](layouts/dummy.md) | ||
- [Message Pass-Through](layouts/message-pass-through.md) | ||
- [Json](layouts/json.md) | ||
- [Pattern](layouts/pattern.md) | ||
- [Custom layouts](layouts/custom.md) | ||
|
||
- [License](license.md) |
Oops, something went wrong.