From 812c3b6bec522c0fb07495f17a96297dce1652c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Tue, 5 Dec 2023 18:10:45 -0300 Subject: [PATCH] Add english readme --- README.md | 3 ++ README_en_us.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 README_en_us.md diff --git a/README.md b/README.md index fc6914a..c4c6f79 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +

Log Guardian

Open-Source Logger Assistant

@@ -7,6 +8,8 @@ [![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-blue?logo=go&logoColor=white)](https://pkg.go.dev/github.com/fonteeBoa/go-log-guardian) [![go report card](https://goreportcard.com/badge/github.com/fonteeBoa/go-log-guardian "go report card")](https://goreportcard.com/report/github.com/fonteeBoa/go-log-guardian) +English README: Dive into the English version of the project's documentation [here](https://github.com/fonteeboa/go-log-guardian/blob/master/README_en_us.md) + O Log Guardian é uma biblioteca desenvolvida para padronizar e gerenciar logs de maneira eficiente e organizada em sistemas vizando a importância da tradução para o usuário final. Com a flexibilidade de lidar com diferentes tipos de logs, esta biblioteca proporciona uma estrutura consistente para a geração e gerenciamento de logs gerais e específicos, permitindo a integração com diferentes sistemas.

Funcionalidades

diff --git a/README_en_us.md b/README_en_us.md new file mode 100644 index 0000000..0aee3c0 --- /dev/null +++ b/README_en_us.md @@ -0,0 +1,79 @@ +

Log Guardian

+ +

Open-Source Logger Assistant

+ +[![link to Go version](https://img.shields.io/github/go-mod/go-version/fonteeboa/go-log-guardian)](https://img.shields.io/github/go-mod/go-version/fonteeboa/go-log-guardian) +[![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT) +[![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-blue?logo=go&logoColor=white)](https://pkg.go.dev/github.com/fonteeBoa/go-log-guardian) +[![go report card](https://goreportcard.com/badge/github.com/fonteeBoa/go-log-guardian "go report card")](https://goreportcard.com/report/github.com/fonteeBoa/go-log-guardian) + +README em Português: Acesse a versão em Português da documentação do projeto [aqui](https://github.com/fonteeboa/go-log-guardian/blob/master/README.md) + +Log Guardian is a library developed to standardize and efficiently manage logs in systems, emphasizing the importance of translation for the end user. With the flexibility to handle different types of logs, this library provides a consistent structure for generating and managing general and specific logs, allowing integration with various systems. + +

Features

+ +🔹 Log Standardization: Log Guardian offers a unified framework for different types of logs, from function logs and database operation logs to request logs. + +🔹 Flexible Configuration: Allows easy integration with different systems, enabling customization and configuration of logs according to specific needs. + +🔹 Database Connection: In addition to log management, Log Guardian can integrate with different types of databases such as PostgreSQL, MySQL, SQLite, and MongoDB. Configuration is simple, using environment variables to specify connection details. + +🔹 Automatic Log Insertion: When correctly configured with environment variables, Log Guardian can automatically insert logs into the specified database. + +

Usage

+ +Log Guardian is flexible and adapts to the configuration of the environment in which it is run. If the required environment variables are not configured, Log Guardian can still return the specific log template for manual insertion into the database. + +If the environment variables are correctly set with the details of the desired database, Log Guardian can automatically connect to the specified database and insert logs directly into the corresponding table. It returns a boolean value indicating success or failure in inserting data into the database. + +This flexibility allows easy integration and use of Log Guardian in different configuration scenarios, whether just providing log templates for manual insertion or performing automatic insertions into the configured database. + +It is advisable to refer to the Configuration section for details on the necessary environment variables for a complete setup of Log Guardian. + +

Configuration

+ +Log Guardian uses environment variables to configure its database operations, including database connection settings and other essential configurations. Here is the list of available environment variables: + +

Relational Database

+ +#### PostgreSQL +``` +POSTGRES_HOST: Defines the host address for PostgreSQL. +POSTGRES_EXTERNAL_PORT: Specifies the external port for PostgreSQL. +POSTGRES_USER: Username for authentication in PostgreSQL. +POSTGRES_PASSWORD: Password for authentication in PostgreSQL. +POSTGRES_DB: Name of the PostgreSQL database to be used. +``` +#### MySQL +``` +MYSQL_HOST: Defines the host address for MySQL. +MYSQL_PORT: Specifies the port for MySQL. +MYSQL_USER: Username for authentication in MySQL. +MYSQL_PASSWORD: Password for authentication in MySQL. +MYSQL_DBNAME: Name of the MySQL database to be used. +``` +#### SQLite +``` +SQLITE_PATH: Path to the SQLite file if it is the chosen database. +``` + +

NoSQL Database

+ +#### MongoDB +``` +MONGODB_URI: Defines the connection URI for MongoDB. +MONGODB_DBNAME: Name of the MongoDB database to be used. +``` + +

General Configuration

+ +``` +LOG_GUARDIAN_DATABASE_TYPE: Specifies the type of database to be used by Log Guardian (Values: sqlite, postgres, mysql, mongodb). +``` + +

Notes

+ +To utilize the automatic functions of go-log-guardian, using the LOG_GUARDIAN_DATABASE_TYPE variable is mandatory, as some validations are performed based on this variable before calling the insertion routines. + +Ensure to provide valid and correct values for each of these environment variables. This ensures proper connection and functioning of Log Guardian with the desired database.