Skip to content

Commit 0064c55

Browse files
chore: updated wiki, readme, changelog and version number
1 parent 287d697 commit 0064c55

File tree

3 files changed

+13
-56
lines changed

3 files changed

+13
-56
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
# CHANGELOG
2+
## [1.0.0-alpha.3] - 25-03-2024
3+
### Changed
4+
- README file and updated the Wiki page.
5+
6+
### Fixed
7+
- Default configuration for `fancy` preset.
8+
29
## [1.0.0-alpha.2] - 21-03-2024
310
### Added
411
- Customisable log type/level colour.

README.md

Lines changed: 5 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ An advanced and customisable logging library for [ElysiaJS](https://elysiajs.com
99
- [Logestic](#logestic)
1010
- [Table of Contents](#table-of-contents)
1111
- [Installation](#installation)
12-
- [Configuration](#configuration)
1312
- [Usage](#usage)
14-
- [Preset logging](#preset-request-logging)
15-
- [Custom logging](#custom-request-logging)
13+
- [Documentation](#documentation)
1614
- [Contributing Guidelines](#contributing-guidelines)
1715
- [License](#license)
1816

@@ -26,11 +24,7 @@ Add the package to your Elysia Project via [bun](https://bun.sh).
2624

2725
## Usage
2826

29-
There are two ways to add logging to your Elysia application.
30-
31-
### Preset request logging
32-
33-
Currently, there are these [presets](./src/presets/index.ts) available to use.
27+
There are two ways to add logging to your Elysia application. The quickest way to use this logger is using a preset.
3428

3529
```typescript
3630
import { Elysia } from 'elysia';
@@ -45,55 +39,11 @@ const app = new Elysia()
4539
});
4640
```
4741

48-
![Custom Preset](./screenshots/custom-preset.png)
49-
50-
### Custom request logging
51-
52-
If you don't like any of presets, you can configure Logestic to log your requests in your way.
53-
54-
1. Create a `Logestic` instance, optionally where you wish to log.
55-
2. Call `use` to tell `Logestic` the information you wish to use.
56-
3. Finally, create an `Elysia` instance on `custom` with the formatting function.
57-
58-
```typescript
59-
// ./logger.ts
60-
import { Logestic, chalk } from 'logestic';
61-
62-
// exports an Elysia instance
63-
export default new Logestic()
64-
.use(['method', 'path', 'time', 'status'])
65-
.format({
66-
onSuccess({ method, path, time, status }) {
67-
return `[${time}]: ${method} ${path} | ${status}`
68-
},
69-
onFailure({ request, error, code, datetime }) {
70-
return chalk.red(`ERROR [${datetime}]: ${request.method} ${request.url} | ${code}`)
71-
}
72-
});
73-
74-
// ./index.ts
75-
import myLogger from './logger';
76-
77-
const app = new Elysia()
78-
.use(myLogger)
79-
.get('/', () => "Hello from server")
80-
/* ... */
81-
.listen(3000, () => {
82-
console.log("Server is running on port 3000")
83-
});
84-
```
85-
86-
Consider contributing your own preset; check [contributing guidelines](#contributing-guidelines).
42+
These [presets](https://github.com/cybercoder-naj/logestic/wiki/Presets) available to use.
8743

88-
## Configuration
44+
## Documentation
8945

90-
| Name | Type | Description | Default |
91-
| :--: | :--: | :-------- | :----- |
92-
| dest | `BunFile` | The destination file for logging. | `Bun.stdout` |
93-
| showLevel | `boolean` | Whether to show the log level. | `false` |
94-
| logLevelColour | `LogLevelColour` | The colour of each log level. | `{ [key in LogType]: undefined }` |
95-
| httpLogging | `boolean` | Log successful http requests | `true` |
96-
| explicitLogging | `boolean` | Allow logging for explicit calls | `true` |
46+
To view the full documentation, view the [wiki](https://github.com/cybercoder-naj/logestic/wiki/).
9747

9848
## Contributing Guidelines
9949

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "logestic",
3-
"version": "1.0.0-alpha.2",
3+
"version": "1.0.0-alpha.3",
44
"author": "Nishant Aanjaney Jalan <[email protected]>",
55
"description": "An advanced and customisable logging library for ElysiaJS",
66
"keywords": [

0 commit comments

Comments
 (0)