Skip to content

Commit 1905604

Browse files
committed
Add license in package.json
1 parent e5f8b05 commit 1905604

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,6 @@ tsconfig*
9696

9797
# Ignore map files in npm
9898
*.js.map
99+
100+
# Ignore docs
101+
/docs*

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Browser:
108108
```typescript
109109
import { Logger } from "tslog";
110110

111-
const logger = new Logger({ name: "myLogger" });
111+
const logger = new Logger();
112112
logger.silly("I am a silly log.");
113113
logger.trace("I am a trace log.");
114114
logger.debug("I am a debug log.");
@@ -148,7 +148,7 @@ Every incoming log message runs through a number of steps before being displayed
148148

149149
- **log message** Log message comes in through the `BaseLogger.log()` method
150150
- **mask** If masking is configured, log message gets recursively masked
151-
- **toLogObj** Log message gets transformed into a log object: A default typed log object can be passed to constructor as a second parameter and will be cloned and enriched with the incoming log parameters. Error properties will be handled accordingly. If there is only one log property, and it's an object, both objects (cloned default `logObj` as well as the log property object will be merged.) If there are more than one, they will be put into properties called "0", "1", ... and so on. Alternatively, log message properties can be put into a property with a name configured with the `argumentsArrayName` setting.
151+
- **toLogObj** Log message gets transformed into a log object: A default typed log object can be passed to constructor as a second parameter and will be cloned and enriched with the incoming log parameters. Error properties will be handled accordingly. If there is only one log property, and it's an object, both objects (cloned default `logObj` as well as the log property object) will be merged. If there are more than one, they will be put into properties called "0", "1", ... and so on. Alternatively, log message properties can be put into a property with a name configured with the `argumentsArrayName` setting.
152152
- **addMetaToLogObj** Additional meta information, like the source code position of the log will be gathered and added to the `_meta` property or any other one configured with the setting `metaProperty`.
153153
- **format** In case of "pretty" configuration, a log object will be formatted based on the templates configured in settings. Meta will be formatted by the method `_prettyFormatLogObjMeta` and the actual log payload will be formatted by `prettyFormatLogObj`. Both steps can be overwritten with the settings `formatMeta` and `formatMeta`.
154154
- **transport** Last step is to "transport" a log message to every attached transport from the setting `attachedTransports`. Last step is the actual transport, either JSON (`transportJSON`), formatted (`transportFormatted`) or omitted, if its set to "hidden". Both default transports can also be overwritten by the corresponding setting.
@@ -157,7 +157,7 @@ Every incoming log message runs through a number of steps before being displayed
157157

158158
`tslog` comes with default log level `0: silly`, `1: trace`, `2: debug`, `3: info`, `4: warn`, `5: error`, `6: fatal`.
159159

160-
> **Tip:** Each logging method has a return type, which is a _JSON_ representation of the log message (`ILogObject`).
160+
> **Tip:** Each logging method has a return type, which is a _JSON_ representation of the log message (`ILogObj`).
161161
162162
```typescript
163163
import { Logger } from "tslog";
@@ -477,7 +477,7 @@ For every log:
477477
});
478478
```
479479

480-
For `pretty` logs log:
480+
For `pretty` logs:
481481
```typescript
482482
const logger = new Logger({
483483
type: "pretty",
@@ -495,7 +495,7 @@ For `pretty` logs log:
495495
});
496496
```
497497

498-
For `JSON` logs log (no formatting happens here):
498+
For `JSON` logs (no formatting happens here):
499499
```typescript
500500
const logger = new Logger({
501501
type: "pretty",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "4.0.1",
44
"description": "📝 Extensible TypeScript Logger for Node.js and Browser: Dependency free, Fully customizable, Pretty errors, stack traces, and JSON output to attachable transports.",
55
"author": "Eugene <[email protected]> (http://fullstack.build/)",
6-
"license": "",
6+
"license": "MIT",
77
"funding": "https://github.com/fullstack-build/tslog?sponsor=1",
88
"homepage": "https://tslog.js.org",
99
"repository": {

0 commit comments

Comments
 (0)