Skip to content

Commit

Permalink
docs: refactor logn tree & spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
ibnumardini committed Dec 26, 2020
1 parent 4214483 commit d0334ef
Showing 1 changed file with 51 additions and 37 deletions.
88 changes: 51 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</div>

## About Logn

Logn <em><strong>:/logen/</strong></em> is a simple log management library for go app ツ, with several features provided such as :

- Generate log by day
Expand All @@ -19,27 +20,28 @@ Logn <em><strong>:/logen/</strong></em> is a simple log management library for g
- Deleting old log directory

## Logn Tree
```

```bash
go-app
│ main
|
───log
| └───2020
| └───12
| ───01
| | info.log
| | warning.log
| | error.log
| ───02
| | info.log
| | warning.log
| | error.log
|
───log
└───2020
└───12
───01
info.log
warning.log
error.log
───02
info.log
warning.log
error.log
└───log_zip
───2019
| log_12_2019.zip
───2020
| log_01_2020.zip
───2019
log_12_2019.zip
───2020
log_01_2020.zip
```

## Installation
Expand All @@ -51,7 +53,9 @@ go get -u github.com/ibnumardini/logn
```

## Configuration
- make config file [```logn_config.json```](https://github.com/ibnumardini/logn/blob/master/logn_config_sample.json) in your root project directory

- make config file [`logn_config.json`](https://github.com/ibnumardini/logn/blob/master/logn_config_sample.json) in your root project directory

```json
{
"logn_is_active": true,
Expand All @@ -73,25 +77,29 @@ go get -u github.com/ibnumardini/logn
}
}
```

### Config description
* ```logn_is_active``` used to actived or deactived logn package

- `logn_is_active` used to actived or deactived logn package

#### log
* ```logn_dir``` used for set default log directory name
* ```logn_default_loc``` used for set default timezone
* ```logn_print_console``` used to print log at console

- `logn_dir` used for set default log directory name
- `logn_default_loc` used for set default timezone
- `logn_print_console` used to print log at console

#### telegram
* ```logn_tg_send``` used to actived or deactived report warning/error log to telegram
* ```logn_app_name``` used to set title in report telegram message
* ```logn_tg_token``` used for telegram bot token
* ```logn_tg_chat_id``` used for set where bot send report message

- `logn_tg_send` used to actived or deactived report warning/error log to telegram
- `logn_app_name` used to set title in report telegram message
- `logn_tg_token` used for telegram bot token
- `logn_tg_chat_id` used for set where bot send report message

#### zip
* ```logn_is_zipped``` used to actived or deactived automate zipped log in one month
* ```logn_dir_zip``` used for set default log zip directory name
* ```logn_del_old_dir``` used to set automate deleting old zip directory after zipped

- `logn_is_zipped` used to actived or deactived automate zipped log in one month
- `logn_dir_zip` used for set default log zip directory name
- `logn_del_old_dir` used to set automate deleting old zip directory after zipped

## Usage

Expand All @@ -102,22 +110,28 @@ logn.ErrorLog(fmt.Sprintln("error message!"))
```

### Usage description
* ```logn.InfoLog()``` used to make log type info
* ```logn.WarningLog()``` used to make log type warning
* ```logn.ErrorLog()``` used to make log type error

- `logn.InfoLog()` used to make log type info
- `logn.WarningLog()` used to make log type warning
- `logn.ErrorLog()` used to make log type error

#### parameter
* if you have complex string, you can format first using ```fmt.Sprintf()``` or ```fmt.Sprintln()``` before input in the parameters

- if you have complex string, you can format first using `fmt.Sprintf()` or `fmt.Sprintln()` before input in the parameters

### Zipping log using cron
* set ```logn.CronZip(1)```at your init func
* set like this ```./app logn_zip_run``` when run your app

- set `logn.CronZip(1)`at your init func
- set like this `./app logn_zip_run` when run your app

#### parameter
* fill in the parameter with the position of the argument according to what you set, param type is int

- fill in the parameter with the position of the argument according to what you set, param type is int

## Contributing

Let's build this Logn library to make it even better.

## License

Logn is under the [MIT License](LICENSE.md)

0 comments on commit d0334ef

Please sign in to comment.