This repository has been archived by the owner on Jul 25, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2815291
Showing
12 changed files
with
4,269 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = tab | ||
trim_trailing_whitespace = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
yarn-error.log | ||
dist | ||
.coverage |
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,2 @@ | ||
.coverage | ||
dist |
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,7 @@ | ||
{ | ||
"printWidth": 120, | ||
"singleQuote": false, | ||
"tabWidth": 4, | ||
"trailingComma": "all", | ||
"useTabs": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## Unreleased |
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,20 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) Brian Faust <hello@basecode.sh> | ||
|
||
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,32 @@ | ||
# common-logger | ||
|
||
> A common interface for reusable Logger implementations in TypeScript. | ||
[![Latest Version](https://badgen.now.sh/npm/v/@faustbrian/common-logger)](https://www.npmjs.com/package/@faustbrian/common-logger) | ||
[![Node Engine](https://badgen.now.sh/npm/node/@faustbrian/common-logger)](https://www.npmjs.com/package/@faustbrian/common-logger) | ||
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT) | ||
|
||
## Installation | ||
|
||
```bash | ||
yarn add @vendor/common-logger | ||
``` | ||
|
||
## Testing | ||
|
||
```bash | ||
yarn test | ||
``` | ||
|
||
## Security | ||
|
||
If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed. | ||
|
||
## Credits | ||
|
||
- [Brian Faust](https://github.com/faustbrian) | ||
- [All Contributors](../../../../contributors) | ||
|
||
## License | ||
|
||
[MIT](LICENSE) © [Brian Faust](https://basecode.sh) |
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,39 @@ | ||
{ | ||
"name": "@faustbrian/common-logger", | ||
"version": "0.1.0", | ||
"description": "A common interface for reusable Logger implementations in TypeScript.", | ||
"homepage": "https://github.com/faustbrian/common-logger", | ||
"bugs": { | ||
"url": "https://github.com/faustbrian/common-logger/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:faustbrian/common-logger.git" | ||
}, | ||
"license": "MIT", | ||
"author": "Brian Faust <hello@basecode.sh>", | ||
"files": [ | ||
"dist" | ||
], | ||
"main": "dist/index", | ||
"types": "dist/index", | ||
"scripts": { | ||
"build": "yarn clean && tsc", | ||
"build:watch": "yarn build -w", | ||
"clean": "rimraf .coverage dist tmp", | ||
"format": "yarn lint && yarn prettier", | ||
"lint": "tslint -c tslint.json 'src/**/*.ts' --fix", | ||
"prepublishOnly": "yarn format && yarn build", | ||
"prettier": "prettier --write \"./*.{ts,js,json,md}\" \"./**/*.{ts,js,json,md}\"" | ||
}, | ||
"devDependencies": { | ||
"@sindresorhus/tsconfig": "^0.3.0", | ||
"@types/jest": "^24.0.11", | ||
"@types/node": "^11.13.7", | ||
"prettier": "^1.17.0", | ||
"rimraf": "^2.6.3", | ||
"tslint": "^5.16.0", | ||
"tslint-config-prettier": "^1.18.0", | ||
"typescript": "^3.4.5" | ||
} | ||
} |
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,47 @@ | ||
export interface ILogger { | ||
/** | ||
* System is unusable. | ||
*/ | ||
emergency<T = any>(message: string, context?: T): void; | ||
|
||
/** | ||
* Action must be taken immediately. | ||
*/ | ||
alert<T = any>(message: string, context?: T): void; | ||
|
||
/** | ||
* Critical conditions. | ||
*/ | ||
critical<T = any>(message: string, context?: T): void; | ||
|
||
/** | ||
* Runtime errors that do not require immediate action but should typically | ||
* be logged and monitored. | ||
*/ | ||
error<T = any>(message: string, context?: T): void; | ||
|
||
/** | ||
* Exceptional occurrences that are not errors. | ||
*/ | ||
warning<T = any>(message: string, context?: T): void; | ||
|
||
/** | ||
* Normal but significant events. | ||
*/ | ||
notice<T = any>(message: string, context?: T): void; | ||
|
||
/** | ||
* Interesting events. | ||
*/ | ||
info<T = any>(message: string, context?: T): void; | ||
|
||
/** | ||
* Detailed debug information. | ||
*/ | ||
debug<T = any>(message: string, context?: T): void; | ||
|
||
/** | ||
* Logs with an arbitrary level. | ||
*/ | ||
log<T = any>(level: string, message: string, context?: T): void; | ||
} |
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,19 @@ | ||
{ | ||
"extends": "@sindresorhus/tsconfig", | ||
"compilerOptions": { | ||
"alwaysStrict": true, | ||
"incremental": true, | ||
"lib": ["es2018"], | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"outDir": "dist", | ||
"removeComments": true, | ||
"resolveJsonModule": true, | ||
"sourceMap": true, | ||
"strictNullChecks": true, | ||
"target": "es2018", | ||
"typeRoots": ["node_modules/@types"] | ||
}, | ||
"include": ["src/**/**.ts"], | ||
"exclude": ["node_modules", "dist", "**/*.spec.ts", "**/*.test.ts"] | ||
} |
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,3 @@ | ||
{ | ||
"extends": ["tslint:latest", "tslint-config-prettier"] | ||
} |
Oops, something went wrong.