Skip to content

Commit

Permalink
Merge branch 'beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
ptkdev committed Aug 4, 2020
2 parents 0b75f57 + 69f912b commit c4166cc
Show file tree
Hide file tree
Showing 11 changed files with 2,331 additions and 1,772 deletions.
134 changes: 71 additions & 63 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,64 +1,72 @@
{
"projectName": "ptkdev-logger",
"projectOwner": "ptkdev",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": true,
"contributors": [
{
"login": "ptkdev",
"name": "Patryk Rzucidło",
"avatar_url": "https://avatars1.githubusercontent.com/u/442844?v=4",
"profile": "https://ptk.dev",
"contributions": [
"code",
"translation",
"doc",
"bug"
]
},
{
"login": "agoalofalife",
"name": "Ilua Chubarov",
"avatar_url": "https://avatars1.githubusercontent.com/u/15719824?v=4",
"profile": "https://github.com/agoalofalife",
"contributions": [
"code"
]
},
{
"login": "Bruck1701",
"name": "Bruno Kümmel",
"avatar_url": "https://avatars2.githubusercontent.com/u/17711277?v=4",
"profile": "https://github.com/Bruck1701",
"contributions": [
"code",
"translation"
]
},
{
"login": "alinaosv",
"name": "Alina Osv",
"avatar_url": "https://avatars3.githubusercontent.com/u/60554247?v=4",
"profile": "https://github.com/alinaosv",
"contributions": [
"translation"
]
},
{
"login": "Syltech",
"name": "Sylvain Téchené",
"avatar_url": "https://avatars1.githubusercontent.com/u/3882925?v=4",
"profile": "https://github.com/Syltech",
"contributions": [
"translation"
]
}
],
"contributorsPerLine": 6,
"commitConvention": "none"
}
"projectName": "ptkdev-logger",
"projectOwner": "ptkdev",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": true,
"contributors": [
{
"login": "ptkdev",
"name": "Patryk Rzucidło",
"avatar_url": "https://avatars1.githubusercontent.com/u/442844?v=4",
"profile": "https://ptk.dev",
"contributions": [
"code",
"translation",
"doc",
"bug"
]
},
{
"login": "agoalofalife",
"name": "Ilua Chubarov",
"avatar_url": "https://avatars1.githubusercontent.com/u/15719824?v=4",
"profile": "https://github.com/agoalofalife",
"contributions": [
"code"
]
},
{
"login": "Bruck1701",
"name": "Bruno Kümmel",
"avatar_url": "https://avatars2.githubusercontent.com/u/17711277?v=4",
"profile": "https://github.com/Bruck1701",
"contributions": [
"code",
"translation"
]
},
{
"login": "alinaosv",
"name": "Alina Osv",
"avatar_url": "https://avatars3.githubusercontent.com/u/60554247?v=4",
"profile": "https://github.com/alinaosv",
"contributions": [
"translation"
]
},
{
"login": "Syltech",
"name": "Sylvain Téchené",
"avatar_url": "https://avatars1.githubusercontent.com/u/3882925?v=4",
"profile": "https://github.com/Syltech",
"contributions": [
"translation"
]
},
{
"login": "GiovanniCardamone",
"name": "Giovanni Cardamone",
"avatar_url": "https://avatars.githubusercontent.com/giovannicardamone",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 6,
"commitConvention": "none"
}
3 changes: 0 additions & 3 deletions .jshintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ loginpin.txt
.pm2-process.json
.all-contributorsrc
.eslintcache
.jsconfig.js
jsconfig.js
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# v1.7.0 (August 05, 2020)
* Feature: typescript typization (Thanks: Giovanni Cardamone)

[![](https://img.shields.io/badge/donate-paypal-005EA6.svg?logo=paypal)](https://www.paypal.me/ptkdev) [![](https://img.shields.io/badge/donate-patreon-F87668.svg?logo=patreon)](https://www.patreon.com/ptkdev) [![](https://img.shields.io/badge/donate-sponsors-ea4aaa.svg?logo=github)](https://github.com/sponsors/ptkdev/) [![](https://img.shields.io/badge/donate-ko--fi-29abe0.svg?logo=ko-fi)](https://ko-fi.com/ptkdev)


# v1.6.0 (May 24, 2020)
* Fix: info color (default palette) changed from #2ECC71 to #4CAF50
* Fix: docs url with custom pallette
* Fix: stackoverflow url with custom pallette

[![](https://img.shields.io/badge/donate-paypal-005EA6.svg?logo=paypal)](https://www.paypal.me/ptkdev) [![](https://img.shields.io/badge/donate-patreon-F87668.svg?logo=patreon)](https://www.patreon.com/ptkdev) [![](https://img.shields.io/badge/donate-sponsors-ea4aaa.svg?logo=github)](https://github.com/sponsors/ptkdev/) [![](https://img.shields.io/badge/donate-ko--fi-29abe0.svg?logo=ko-fi)](https://ko-fi.com/ptkdev)


# v1.5.0 (May 20, 2020)
* Feature: logrotate
* Feature: palette: customize colors
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# 🦒 Beautiful Logger for Node.js

[![](https://img.shields.io/badge/version-v1.6.0-lightgrey.svg)](https://github.com/ptkdev/ptkdev-logger/releases) [![](https://img.shields.io/npm/v/@ptkdev/logger.svg)](https://www.npmjs.com/package/@ptkdev/logger) [![](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/ptkdev/ptkdev-logger/blob/master/LICENSE.md) [![](https://img.shields.io/badge/ES-9-F7DF1E.svg)](https://wikipedia.org/wiki/ECMAScript) [![](https://snyk.io/test/github/ptkdev/ptkdev-logger/badge.svg)](https://snyk.io/test/github/ptkdev/ptkdev-logger) [![](https://discordapp.com/api/guilds/383373985666301975/embed.png)](http://discord.ptkdev.io)
[![](https://img.shields.io/badge/version-v1.7.0-lightgrey.svg)](https://github.com/ptkdev/ptkdev-logger/releases) [![](https://img.shields.io/npm/v/@ptkdev/logger.svg)](https://www.npmjs.com/package/@ptkdev/logger) [![](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/ptkdev/ptkdev-logger/blob/master/LICENSE.md) [![](https://img.shields.io/badge/ES-9-F7DF1E.svg)](https://wikipedia.org/wiki/ECMAScript) [![](https://snyk.io/test/github/ptkdev/ptkdev-logger/badge.svg)](https://snyk.io/test/github/ptkdev/ptkdev-logger) [![](https://discordapp.com/api/guilds/383373985666301975/embed.png)](http://discord.ptkdev.io)

> The best alternative to the console.log statement
Expand Down Expand Up @@ -117,7 +117,7 @@ You can customize palette colors with Object `palette` and with hexcode values.
- `text` is message of log on right
- `background` is background color on left side

```json
```javascript
{
...
"palette": {
Expand Down Expand Up @@ -171,7 +171,7 @@ See folder `examples`, run with `node example.js`.

Rotates the file when size exceeds 10 megabytes (optional, default 10M - values: 10B (byte) / 10K (kilobyte)/ 10M (megabyte)/ 10G (gigabyte))

```json
```javascript
...
"rotate": {
"size": "10M",
Expand Down Expand Up @@ -203,11 +203,12 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://ptk.dev"><img src="https://avatars1.githubusercontent.com/u/442844?v=4" width="100px;" alt=""/><br /><sub><b>Patryk Rzucidło</b></sub></a><br /><a href="https://github.com/ptkdev/ptkdev-logger/commits?author=ptkdev" title="Code">💻</a> <a href="#translation-ptkdev" title="Translation">🌍</a> <a href="https://github.com/ptkdev/ptkdev-logger/commits?author=ptkdev" title="Documentation">📖</a> <a href="https://github.com/ptkdev/ptkdev-logger/issues?q=author%3Aptkdev" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/agoalofalife"><img src="https://avatars1.githubusercontent.com/u/15719824?v=4" width="100px;" alt=""/><br /><sub><b>Ilua Chubarov</b></sub></a><br /><a href="https://github.com/ptkdev/ptkdev-logger/commits?author=agoalofalife" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Bruck1701"><img src="https://avatars2.githubusercontent.com/u/17711277?v=4" width="100px;" alt=""/><br /><sub><b>Bruno Kümmel</b></sub></a><br /><a href="https://github.com/ptkdev/ptkdev-logger/commits?author=Bruck1701" title="Code">💻</a> <a href="#translation-Bruck1701" title="Translation">🌍</a></td>
<td align="center"><a href="https://github.com/alinaosv"><img src="https://avatars3.githubusercontent.com/u/60554247?v=4" width="100px;" alt=""/><br /><sub><b>Alina Osv</b></sub></a><br /><a href="#translation-alinaosv" title="Translation">🌍</a></td>
<td align="center"><a href="https://github.com/Syltech"><img src="https://avatars1.githubusercontent.com/u/3882925?v=4" width="100px;" alt=""/><br /><sub><b>Sylvain Téchené</b></sub></a><br /><a href="#translation-Syltech" title="Translation">🌍</a></td>
<td align="center"><a href="https://ptk.dev"><img src="https://avatars1.githubusercontent.com/u/442844?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Patryk Rzucidło</b></sub></a><br /><a href="https://github.com/ptkdev/ptkdev-logger/commits?author=ptkdev" title="Code">💻</a> <a href="#translation-ptkdev" title="Translation">🌍</a> <a href="https://github.com/ptkdev/ptkdev-logger/commits?author=ptkdev" title="Documentation">📖</a> <a href="https://github.com/ptkdev/ptkdev-logger/issues?q=author%3Aptkdev" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/agoalofalife"><img src="https://avatars1.githubusercontent.com/u/15719824?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ilua Chubarov</b></sub></a><br /><a href="https://github.com/ptkdev/ptkdev-logger/commits?author=agoalofalife" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Bruck1701"><img src="https://avatars2.githubusercontent.com/u/17711277?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Bruno Kümmel</b></sub></a><br /><a href="https://github.com/ptkdev/ptkdev-logger/commits?author=Bruck1701" title="Code">💻</a> <a href="#translation-Bruck1701" title="Translation">🌍</a></td>
<td align="center"><a href="https://github.com/alinaosv"><img src="https://avatars3.githubusercontent.com/u/60554247?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Alina Osv</b></sub></a><br /><a href="#translation-alinaosv" title="Translation">🌍</a></td>
<td align="center"><a href="https://github.com/Syltech"><img src="https://avatars1.githubusercontent.com/u/3882925?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Sylvain Téchené</b></sub></a><br /><a href="#translation-Syltech" title="Translation">🌍</a></td>
<td align="center"><img src="https://avatars.githubusercontent.com/giovannicardamone?s=100" width="100px;" alt=""/><br /><sub><b>Giovanni Cardamone</b></sub><br /><a href="https://github.com/ptkdev/ptkdev-logger/commits?author=GiovanniCardamone" title="Code">💻</a></td>
</tr>
</table>

Expand Down Expand Up @@ -236,4 +237,4 @@ I love snake_case syntax sorry for this 😭 don't hate me.
* Images and logos have **CC BY-NC 4.0 License** ([Freepik](https://it.freepik.com/) Premium License)
* Documentations and Translations have **CC BY 4.0 License**

###### Copyleft (c) 2020 [Patryk Rzucidło](https://ptk.dev) ([@PTKDev](https://twitter.com/ptkdev)) <[support@ptkdev.io](mailto:support@ptkdev.io)>
###### Copyleft (c) 2020 [Patryk Rzucidło](https://ptk.dev) ([@PTKDev](https://twitter.com/ptkdev)) <[support@ptkdev.io](mailto:support@ptkdev.io)>
59 changes: 59 additions & 0 deletions modules/logger.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
declare module "@ptkdev/logger" {
interface RotateType {
size: "10B" | "10K" | "10M" | "10G";
encoding?: string;
}

interface PaletteElement {
label: string;
text: string;
background: string;
}

interface PaletteType {
info?: PaletteElement;
warning?: PaletteElement;
error?: PaletteElement;
stackoverflow?: PaletteElement;
docs?: PaletteElement;
debug?: PaletteElement;
sponsor?: PaletteElement;
time?: Omit<PaletteElement, "text">;
}

interface PathType {
debug_log: string;
error_log: string;
}

interface LoggerOptions {
language?: "de" | "en" | "es" | "fr" | "it" | "pl" | "pt" | "ru";
colors?: boolean;
debug?: boolean;
info?: boolean;
warning?: boolean;
error?: boolean;
sponsor?: boolean;
write?: boolean;
type?: "log" | "json";
rotate?: RotateType;
palette?: PaletteType;
path?: PathType;
}

export default class Logger {
constructor(options?: LoggerOptions);

debug?(message: string, tag?: string): void;
info?(message: string, tag?: string): void;
warning?(message: string, tag?: string): void;
error?(message: string, tag?: string): void;
sponsor?(message: string, tag?: string): void;
stackoverflow?(
message: string,
tag?: string,
error_string?: string
): void;
docs?(message: string, url?: string, tag?: string): void;
}
}
Loading

0 comments on commit c4166cc

Please sign in to comment.