Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        

#

Gamu Logger - Main Page

###

🏠 Main page | 🐍 Python | 🌐 Javascript

##

📚 Table of Contents


✨ Features


🔨 Installation


💡 Examples


🚨 Issue


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, critical

error("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 !