Skip to content

Commit c4166cc

Browse files
committed
Merge branch 'beta'
2 parents 0b75f57 + 69f912b commit c4166cc

File tree

11 files changed

+2331
-1772
lines changed

11 files changed

+2331
-1772
lines changed

.all-contributorsrc

Lines changed: 71 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,72 @@
11
{
2-
"projectName": "ptkdev-logger",
3-
"projectOwner": "ptkdev",
4-
"repoType": "github",
5-
"repoHost": "https://github.com",
6-
"files": [
7-
"README.md"
8-
],
9-
"imageSize": 100,
10-
"commit": true,
11-
"contributors": [
12-
{
13-
"login": "ptkdev",
14-
"name": "Patryk Rzucidło",
15-
"avatar_url": "https://avatars1.githubusercontent.com/u/442844?v=4",
16-
"profile": "https://ptk.dev",
17-
"contributions": [
18-
"code",
19-
"translation",
20-
"doc",
21-
"bug"
22-
]
23-
},
24-
{
25-
"login": "agoalofalife",
26-
"name": "Ilua Chubarov",
27-
"avatar_url": "https://avatars1.githubusercontent.com/u/15719824?v=4",
28-
"profile": "https://github.com/agoalofalife",
29-
"contributions": [
30-
"code"
31-
]
32-
},
33-
{
34-
"login": "Bruck1701",
35-
"name": "Bruno Kümmel",
36-
"avatar_url": "https://avatars2.githubusercontent.com/u/17711277?v=4",
37-
"profile": "https://github.com/Bruck1701",
38-
"contributions": [
39-
"code",
40-
"translation"
41-
]
42-
},
43-
{
44-
"login": "alinaosv",
45-
"name": "Alina Osv",
46-
"avatar_url": "https://avatars3.githubusercontent.com/u/60554247?v=4",
47-
"profile": "https://github.com/alinaosv",
48-
"contributions": [
49-
"translation"
50-
]
51-
},
52-
{
53-
"login": "Syltech",
54-
"name": "Sylvain Téchené",
55-
"avatar_url": "https://avatars1.githubusercontent.com/u/3882925?v=4",
56-
"profile": "https://github.com/Syltech",
57-
"contributions": [
58-
"translation"
59-
]
60-
}
61-
],
62-
"contributorsPerLine": 6,
63-
"commitConvention": "none"
64-
}
2+
"projectName": "ptkdev-logger",
3+
"projectOwner": "ptkdev",
4+
"repoType": "github",
5+
"repoHost": "https://github.com",
6+
"files": [
7+
"README.md"
8+
],
9+
"imageSize": 100,
10+
"commit": true,
11+
"contributors": [
12+
{
13+
"login": "ptkdev",
14+
"name": "Patryk Rzucidło",
15+
"avatar_url": "https://avatars1.githubusercontent.com/u/442844?v=4",
16+
"profile": "https://ptk.dev",
17+
"contributions": [
18+
"code",
19+
"translation",
20+
"doc",
21+
"bug"
22+
]
23+
},
24+
{
25+
"login": "agoalofalife",
26+
"name": "Ilua Chubarov",
27+
"avatar_url": "https://avatars1.githubusercontent.com/u/15719824?v=4",
28+
"profile": "https://github.com/agoalofalife",
29+
"contributions": [
30+
"code"
31+
]
32+
},
33+
{
34+
"login": "Bruck1701",
35+
"name": "Bruno Kümmel",
36+
"avatar_url": "https://avatars2.githubusercontent.com/u/17711277?v=4",
37+
"profile": "https://github.com/Bruck1701",
38+
"contributions": [
39+
"code",
40+
"translation"
41+
]
42+
},
43+
{
44+
"login": "alinaosv",
45+
"name": "Alina Osv",
46+
"avatar_url": "https://avatars3.githubusercontent.com/u/60554247?v=4",
47+
"profile": "https://github.com/alinaosv",
48+
"contributions": [
49+
"translation"
50+
]
51+
},
52+
{
53+
"login": "Syltech",
54+
"name": "Sylvain Téchené",
55+
"avatar_url": "https://avatars1.githubusercontent.com/u/3882925?v=4",
56+
"profile": "https://github.com/Syltech",
57+
"contributions": [
58+
"translation"
59+
]
60+
},
61+
{
62+
"login": "GiovanniCardamone",
63+
"name": "Giovanni Cardamone",
64+
"avatar_url": "https://avatars.githubusercontent.com/giovannicardamone",
65+
"contributions": [
66+
"code"
67+
]
68+
}
69+
],
70+
"contributorsPerLine": 6,
71+
"commitConvention": "none"
72+
}

.jshintrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ loginpin.txt
2121
.pm2-process.json
2222
.all-contributorsrc
2323
.eslintcache
24-
.jsconfig.js
24+
jsconfig.js

CHANGELOG.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
# v1.7.0 (August 05, 2020)
2+
* Feature: typescript typization (Thanks: Giovanni Cardamone)
3+
4+
[![](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)
5+
6+
17
# v1.6.0 (May 24, 2020)
28
* Fix: info color (default palette) changed from #2ECC71 to #4CAF50
39
* Fix: docs url with custom pallette
410
* Fix: stackoverflow url with custom pallette
511

6-
[![](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)
7-
8-
912
# v1.5.0 (May 20, 2020)
1013
* Feature: logrotate
1114
* Feature: palette: customize colors

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# 🦒 Beautiful Logger for Node.js
44

5-
[![](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)
5+
[![](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)
66

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

120-
```json
120+
```javascript
121121
{
122122
...
123123
"palette": {
@@ -171,7 +171,7 @@ See folder `examples`, run with `node example.js`.
171171

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

174-
```json
174+
```javascript
175175
...
176176
"rotate": {
177177
"size": "10M",
@@ -203,11 +203,12 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
203203
<!-- markdownlint-disable -->
204204
<table>
205205
<tr>
206-
<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>
207-
<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>
208-
<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>
209-
<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>
210-
<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>
206+
<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>
207+
<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>
208+
<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>
209+
<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>
210+
<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>
211+
<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>
211212
</tr>
212213
</table>
213214

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

239-
###### Copyleft (c) 2020 [Patryk Rzucidło](https://ptk.dev) ([@PTKDev](https://twitter.com/ptkdev)) <[support@ptkdev.io](mailto:support@ptkdev.io)>
240+
###### Copyleft (c) 2020 [Patryk Rzucidło](https://ptk.dev) ([@PTKDev](https://twitter.com/ptkdev)) <[support@ptkdev.io](mailto:support@ptkdev.io)>

modules/logger.d.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
declare module "@ptkdev/logger" {
2+
interface RotateType {
3+
size: "10B" | "10K" | "10M" | "10G";
4+
encoding?: string;
5+
}
6+
7+
interface PaletteElement {
8+
label: string;
9+
text: string;
10+
background: string;
11+
}
12+
13+
interface PaletteType {
14+
info?: PaletteElement;
15+
warning?: PaletteElement;
16+
error?: PaletteElement;
17+
stackoverflow?: PaletteElement;
18+
docs?: PaletteElement;
19+
debug?: PaletteElement;
20+
sponsor?: PaletteElement;
21+
time?: Omit<PaletteElement, "text">;
22+
}
23+
24+
interface PathType {
25+
debug_log: string;
26+
error_log: string;
27+
}
28+
29+
interface LoggerOptions {
30+
language?: "de" | "en" | "es" | "fr" | "it" | "pl" | "pt" | "ru";
31+
colors?: boolean;
32+
debug?: boolean;
33+
info?: boolean;
34+
warning?: boolean;
35+
error?: boolean;
36+
sponsor?: boolean;
37+
write?: boolean;
38+
type?: "log" | "json";
39+
rotate?: RotateType;
40+
palette?: PaletteType;
41+
path?: PathType;
42+
}
43+
44+
export default class Logger {
45+
constructor(options?: LoggerOptions);
46+
47+
debug?(message: string, tag?: string): void;
48+
info?(message: string, tag?: string): void;
49+
warning?(message: string, tag?: string): void;
50+
error?(message: string, tag?: string): void;
51+
sponsor?(message: string, tag?: string): void;
52+
stackoverflow?(
53+
message: string,
54+
tag?: string,
55+
error_string?: string
56+
): void;
57+
docs?(message: string, url?: string, tag?: string): void;
58+
}
59+
}

0 commit comments

Comments
 (0)