Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gamunetwork/logger
Simple and easy-to-use logging module for python and javascript
https://github.com/gamunetwork/logger
logger logger-js logger-nodejs logger-python logging-library nodejs-logger npm-module npm-package npmjs
Last synced: 21 days ago
JSON representation
Simple and easy-to-use logging module for python and javascript
- Host: GitHub
- URL: https://github.com/gamunetwork/logger
- Owner: GamuNetwork
- License: mit
- Created: 2024-05-08T16:23:56.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-29T18:51:30.000Z (22 days ago)
- Last Synced: 2024-10-29T20:44:53.660Z (22 days ago)
- Topics: logger, logger-js, logger-nodejs, logger-python, logging-library, nodejs-logger, npm-module, npm-package, npmjs
- Language: Python
- Homepage: https://www.npmjs.com/package/@gamunetwork/logger
- Size: 173 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
#
Gamu Logger - Main Page###
##
📚 Table of Contents
The goal of this module is to provide a simple, easy to use but powerful logging module for both python and javascript.
## ✨ Features
- Simple and easy to use (see examples below)
- Supports multiple log levels (DEEP_DEBUG, DEBUG, INFO, WARNING, ERROR, CRITICAL)
- Supports multiple log outputs (console, file) with separated level configuration
- Supports colors in console output
- Contain project modules features based on the current file (see examples below)
- Add decorators to log function calls (see examples below) (python only for now)## 💡 Examples
### Python
```python
from gamuLogger import error, info, criticalerror("This is an error message")
info("This is an info message")
critical("This is a critical message")
```
will output:
```log
[ current datetime ] [ ERROR ] This is an error message
[ current datetime ] [ INFO ] This is an info message
[ current datetime ] [ CRITICAL ] This is a critical message
```### Javascript
```javascript
import { Logger, error, info, critical } from '@gamunetwork/logger';info("This is an info message before setting the module name");
Logger.setModule('module_name'); // set the module name, for this file only
error("This is an error message");
info("This is an info message");
critical("This is a critical message");
```
will output:
```log
[ current datetime ] [ INFO ] This is an info message before setting the module name
[ current datetime ] [ ERROR ] [ module_name ] This is an error message
[ current datetime ] [ INFO ] [ module_name ] This is an info message
[ current datetime ] [ CRITICAL ] [ module_name ] This is a critical message
```> a variant of this decorator named `@deep_debug_func` is also available. It will do the same thing, but will set it output to DEEP_DEBUG instead of DEBUG.
## 🚨 Issue
If you encounter any problem, please let us know by creating an issue here, on github !