Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sys113/negar
call negar in your python source code and write error log & text log to a file ...
https://github.com/sys113/negar
Last synced: 3 months ago
JSON representation
call negar in your python source code and write error log & text log to a file ...
- Host: GitHub
- URL: https://github.com/sys113/negar
- Owner: sys113
- License: mit
- Created: 2019-11-26T15:31:50.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-05T08:12:20.000Z (about 3 years ago)
- Last Synced: 2024-06-28T14:35:47.201Z (5 months ago)
- Language: Python
- Homepage:
- Size: 1.27 MB
- Stars: 29
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
---
![](https://img.shields.io/github/stars/SYS113/negar.svg)
![](https://img.shields.io/badge/language-python-orange.svg)
![](https://img.shields.io/github/forks/SYS113/negar.svg)
![](https://img.shields.io/github/release/SYS113/negar.svg)
![](https://img.shields.io/github/issues/SYS113/negar.svg)
![](https://img.shields.io/badge/license-MIT-informational.svg)---
## *review*
---
## *what is negar*
*call negar module in your python source code and write error log & text log to a file ...
*---
## *installation*+ #### *install by pip*
# linux
sudo python3 -m pip install negar
# windows
py -m pip install negar
+ #### *install by setup.py*# linux
sudo python3 -m pip install https://github.com/sys113/negar/archive/0.6.0.zip
# windows
py -m pip install https://github.com/sys113/negar/archive/0.6.0.zip---
## *example*
+ #### text function
```python# method one - good
import negar
print("start ...")
def test():
a = 'sys113'
return anegar.text(f"'test' function return value is '{test()}'")
print("end ...")
``````python
# method two - excellent
from negar import text
print("start ...")
def test():
a = 'sys113'
return atext(text_log = f"'test' function return value is '{test()}'" , save = "file.txt" , size = 1 , title = "Project Logs" , time = False , line = True , date = True)
print("end ...")
```
+ #### error function
```python# method one - good
import negar
def project():
print("hi!")
Xtry:
project()
except:
negar.error()
``````python
# method two - excellent
from negar import error
def project():
print("hi!")
Xtry:
project()
except:
error(size = 1 , save = 'error.txt' , title = "Project Errors" , time = True , line = True , date = True)
```
---
## *description*
+ #### *log_text*
```python
# write 'log_text' to log file
log_text = 'negar'
```
+ #### *line*
```python
# set 'Flase' and 'True' value for show line python file in log file , default is False ...
line = True
```+ #### *date*
```python
# set 'Flase' and 'True' value for show date in log file , default is True ...
date = True
```+ #### *time*
```python
# set 'Flase' and 'True' value for time in log file , default is True ...
time = True
```
+ #### *save*
```python
# write log to 'negar-log.txt'
save = 'negar-log.txt'
```
+ #### *size*
```python
# set 'size' for log file
size = 2
```
+ #### *title*
```python
# set 'title' for write custom log file title , defult is 'city < country < continent | user name | os > os version > architecture'
title = 'log file title'
```
---## *tips*
+ *log file default size is 2 ...*
+ *log file size range is 1 ... 5 number ...*
+ *maximum size of python file name support is 15 character ...*
+ *maximum number to numbering lines support is 9999999 ...*
+ *maximum python source code line number support is 999999 ...*
+ *default log file name is log.txt ...*
+ *previously defined log file size can'not be resized!
*
---
## *copyright*
*copyright SYS113 - 2019.*---
## *license*
*MIT license , please see LICENSE file.*---
## *donate*
+ *for iranian users : id pay - https://idpay.ir/sys113*
+ *for global users : BTC wallet id - 149JgUmFqG6MvFg79Ldrvdk2bN35ByhMuw*
---
## *contact me*
* *[email](mailto:[email protected])*
* *[telegram](https://t.me/SYS113/)*
* *[instagram](https://instagram.com/sys113/)*
---
## *thanks*
+ *mohamad moradiyani for negar module logo*
+ *Hamed 169 for optimize negar module source code*
---
## *last word*
*hope this is negar useful to you and enjoy it.*---