Skip to content

Commit

Permalink
docs(readme): update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
4lessandrodev committed Jan 29, 2023
1 parent 50dd1b1 commit 89d4748
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ All notable changes to this project will be documented in this file.

---

### [0.0.1-beta.1] - 2022-01-29

### Added

- log: added global log
- log: added step log
- log: added print function
- log: added save local log on txt file

---

### [0.0.1-beta.0] - 2022-01-27

### Added
Expand Down
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,29 @@ This package provide a sdk to manage logs.
---
## Documentation

Application in beta version.
Application in beta version.

Example

```ts
import { randomUUID } from 'node:crypto';
import { Log, Step } from 'ts-logs';

// any id or unique string value
const uid = randomUUID();

// create a global log
const global = Log.init({ name: 'First Log', uid, origin: 'https://global.com' });

// create steps
const info = Step.info({ message: 'Fetching api...', name: 'Request Login' });
const error = Step.error({ message: 'Timeout', name: 'Login', stack: GetStack() });

// add steps to global log
const err = global.addSteps([ info, error ]);

// print or save logs
err.print();
err.writeLocal();

```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ts-logs",
"description": "This package provide a skd for audit and manager logs in nodejs",
"version": "0.0.1-beta.0",
"version": "0.0.1-beta.1",
"main": "index.js",
"types": "index.d.ts",
"author": "Alessandro Dev",
Expand Down

0 comments on commit 89d4748

Please sign in to comment.