https://github.com/fantox/xtra-logger
A lightweight logger, console text colorizer and text formatter with highest formatting options.
https://github.com/fantox/xtra-logger
chalk chalkjs console console-tool logger logger-nodejs logging-library nodejs timezone typescript
Last synced: about 1 month ago
JSON representation
A lightweight logger, console text colorizer and text formatter with highest formatting options.
- Host: GitHub
- URL: https://github.com/fantox/xtra-logger
- Owner: FantoX
- License: gpl-3.0
- Created: 2024-07-07T07:27:19.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-13T09:32:37.000Z (almost 2 years ago)
- Last Synced: 2025-12-28T08:17:48.459Z (4 months ago)
- Topics: chalk, chalkjs, console, console-tool, logger, logger-nodejs, logging-library, nodejs, timezone, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/xtra-logger
- Size: 27.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
XTRA-LOGGER
A lightweight logger, console text coloriser and text formatter with highest formatting options written in Typescript
## Compatibility:
| Version | Compatibility |
| -------------- | ---------------------------- |
| Es5 Javascript |
✅ |
| Es6 Javascript | ✅ |
| Typescript | ✅ |
## Features:
| Feature | Availability |
| ------------------- | ------------------------------- |
| Logging |
✅ |
| Text Formatting | ✅ |
| Console Colorize | ✅ |
| Combined Formatting | ✅ |
| Size | 17 kb |
## Installation:
Node Package Manager (NPM)
```bash
npm i xtra-logger
```
Yet Another Resource Navigator (YARN)
```bash
yarn add xtra-logger
```
## Importing:
For Es5 Js
```js
const { logger, format } = require("xtra-logger");
```
For Es6 Js / Typescript
```js
import { logger, format } from "xtra-logger";
```
## Usage Examples:
**_Logging features:_**
- 5 Log methods available ( info, warn, success, warn, error )
- Changable timezome for Docker / Remote servers ( Search your time zome name from [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). )
- Log format : `[ DD.MM.YY - HH:MM:SS ] - [ TYPE ] - MESSAGE`
_Example :_
```js
import { logger, format } from "xtra-logger";
// Changing the timezone of logger [ optional ] (By default it will use system time)
logger.timeZone("Asia/Kolkata");
// Logging options
logger.info("Starting the server...");
logger.warn("Using node v:18.6");
logger.success("Server started successfully.");
logger.debug("NPM update available.");
logger.error("An error occurd in the server.");
```
_Output :_
**_Text formatting features:_**
- 50+ text formatting / colorizing options available.
- Multiple formatting can be combined together to create new style.
_Example :_
```js
import { logger, format } from "xtra-logger";
// Only bold text
console.log(format.bold("This is a Bold text\n"));
// Combining colours + multiple formatting
console.log(
format.bold(
format.italic(format.cyan("This is a Bold + Italic + Cyan colour text \n"))
)
);
console.log(
format.bgBrightmagenta(
format.strikethrough(
format.lightwhite(
"This is a strikethrough + light white text with bright magenta background"
)
)
)
);
```
_Output :_
## Contributing:
I don't have any contributors in this project yet. Feel free to contribute and making it better.
- Coded by [FantoX](https://github.com/FantoX)
- - Written in [Typescript](https://www.typescriptlang.org/docs/handbook/intro.html)
- License [GNU General Public License v3.0](https://github.com/FantoX/xtra-logger/blob/main/LICENSE)