logfore 2.1.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- logfore-2.1.3.1/LICENSE +21 -0
- logfore-2.1.3.1/PKG-INFO +164 -0
- logfore-2.1.3.1/README.md +144 -0
- logfore-2.1.3.1/logfore/__init__.py +7 -0
- logfore-2.1.3.1/logfore/font.py +605 -0
- logfore-2.1.3.1/logfore/logger.py +412 -0
- logfore-2.1.3.1/logfore/updater.py +62 -0
- logfore-2.1.3.1/logfore/version.py +1 -0
- logfore-2.1.3.1/logfore.egg-info/PKG-INFO +164 -0
- logfore-2.1.3.1/logfore.egg-info/SOURCES.txt +14 -0
- logfore-2.1.3.1/logfore.egg-info/dependency_links.txt +1 -0
- logfore-2.1.3.1/logfore.egg-info/requires.txt +4 -0
- logfore-2.1.3.1/logfore.egg-info/top_level.txt +1 -0
- logfore-2.1.3.1/pyproject.toml +20 -0
- logfore-2.1.3.1/setup.cfg +4 -0
- logfore-2.1.3.1/setup.py +28 -0
logfore-2.1.3.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 karenhoyoshi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
logfore-2.1.3.1/PKG-INFO
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: logfore
|
|
3
|
+
Version: 2.1.3.1
|
|
4
|
+
Summary: A colorful and feature-rich logging library for Python
|
|
5
|
+
Home-page: https://github.com/yourusername/logfore
|
|
6
|
+
Author:
|
|
7
|
+
Author-email:
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/yourusername/logfore
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: colorama
|
|
14
|
+
Requires-Dist: pystyle
|
|
15
|
+
Requires-Dist: requests
|
|
16
|
+
Requires-Dist: packaging
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
Dynamic: requires-python
|
|
20
|
+
|
|
21
|
+
# logfore
|
|
22
|
+
|
|
23
|
+
A colorful, feature-rich logging library for Python with support for styled output, loading animations, ASCII banners, and auto-updates.
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install logfore
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
from logfore import Logger, Loader, Home, LogLevel
|
|
35
|
+
|
|
36
|
+
# Basic logger (colorful style)
|
|
37
|
+
log = Logger(prefix="MyApp")
|
|
38
|
+
|
|
39
|
+
log.info("Application started")
|
|
40
|
+
log.success("Task completed")
|
|
41
|
+
log.warning("Low memory")
|
|
42
|
+
log.failure("Connection lost")
|
|
43
|
+
log.error("Something went wrong")
|
|
44
|
+
log.debug("Debug message")
|
|
45
|
+
log.critical("Fatal error occurred") # exits program
|
|
46
|
+
|
|
47
|
+
# Simple/minimal style
|
|
48
|
+
log2 = Logger(style=2, prefix="MyApp")
|
|
49
|
+
log2.info("Simple style log")
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Features
|
|
53
|
+
|
|
54
|
+
### Logger Styles
|
|
55
|
+
|
|
56
|
+
| Style | Description |
|
|
57
|
+
|-------|-------------|
|
|
58
|
+
| `style=1` | Colorful logger with pink/cyan/magenta theme (default) |
|
|
59
|
+
| `style=2` | Minimal simple logger with arrow prefix |
|
|
60
|
+
|
|
61
|
+
### Logger Options
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
log = Logger(
|
|
65
|
+
style=1, # 1 = ColorLogger, 2 = SimpleLogger
|
|
66
|
+
prefix="MyApp", # Prefix shown in brackets
|
|
67
|
+
github_repository="user/repo", # Displays repo info on start
|
|
68
|
+
level=LogLevel.DEBUG, # Minimum log level to display
|
|
69
|
+
log_file="logs/app.log" # Optional file logging
|
|
70
|
+
)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Log Levels
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from logfore import LogLevel
|
|
77
|
+
|
|
78
|
+
# Available levels (in order):
|
|
79
|
+
LogLevel.DEBUG
|
|
80
|
+
LogLevel.INFO
|
|
81
|
+
LogLevel.WARNING
|
|
82
|
+
LogLevel.SUCCESS
|
|
83
|
+
LogLevel.FAILURE
|
|
84
|
+
LogLevel.CRITICAL
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Timing Support
|
|
88
|
+
|
|
89
|
+
All log methods support optional timing:
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
import time
|
|
93
|
+
|
|
94
|
+
start = time.time()
|
|
95
|
+
# ... do work ...
|
|
96
|
+
end = time.time()
|
|
97
|
+
|
|
98
|
+
log.success("Done!", start=start, end=end)
|
|
99
|
+
# Output: ... [Success] -> Done! In 1.234 Seconds
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Loading Spinner
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
from logfore import Loader
|
|
106
|
+
|
|
107
|
+
# As context manager
|
|
108
|
+
with Loader(prefix="MyApp", desc="Processing...", end="Done!"):
|
|
109
|
+
time.sleep(2)
|
|
110
|
+
|
|
111
|
+
# Manual control
|
|
112
|
+
loader = Loader(desc="Loading...")
|
|
113
|
+
loader.start()
|
|
114
|
+
# ... do work ...
|
|
115
|
+
loader.stop()
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### ASCII Banner (Home Screen)
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
from logfore import Home
|
|
122
|
+
|
|
123
|
+
home = Home(
|
|
124
|
+
text="LOGFORE",
|
|
125
|
+
align="center", # "left", "center", "right"
|
|
126
|
+
adinfo1="v1.0.0",
|
|
127
|
+
adinfo2="by Author",
|
|
128
|
+
credits="GitHub: user",
|
|
129
|
+
clear=True # Clear terminal before display
|
|
130
|
+
)
|
|
131
|
+
home.display()
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Auto Updater
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
from logfore import AutoUpdater, Logger
|
|
138
|
+
|
|
139
|
+
log = Logger()
|
|
140
|
+
updater = AutoUpdater("your-pypi-package-name", log)
|
|
141
|
+
updater.check_for_updates()
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### File Logging
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
log = Logger(log_file="logs/myapp.log")
|
|
148
|
+
log.info("This is saved to file too")
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Questions / Input
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
answer = log.question("What is your name? ")
|
|
155
|
+
print(f"Hello, {answer}!")
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Requirements
|
|
159
|
+
|
|
160
|
+
- Python 3.10+
|
|
161
|
+
- colorama
|
|
162
|
+
- pystyle
|
|
163
|
+
- requests
|
|
164
|
+
- packaging
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# logfore
|
|
2
|
+
|
|
3
|
+
A colorful, feature-rich logging library for Python with support for styled output, loading animations, ASCII banners, and auto-updates.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install logfore
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from logfore import Logger, Loader, Home, LogLevel
|
|
15
|
+
|
|
16
|
+
# Basic logger (colorful style)
|
|
17
|
+
log = Logger(prefix="MyApp")
|
|
18
|
+
|
|
19
|
+
log.info("Application started")
|
|
20
|
+
log.success("Task completed")
|
|
21
|
+
log.warning("Low memory")
|
|
22
|
+
log.failure("Connection lost")
|
|
23
|
+
log.error("Something went wrong")
|
|
24
|
+
log.debug("Debug message")
|
|
25
|
+
log.critical("Fatal error occurred") # exits program
|
|
26
|
+
|
|
27
|
+
# Simple/minimal style
|
|
28
|
+
log2 = Logger(style=2, prefix="MyApp")
|
|
29
|
+
log2.info("Simple style log")
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
### Logger Styles
|
|
35
|
+
|
|
36
|
+
| Style | Description |
|
|
37
|
+
|-------|-------------|
|
|
38
|
+
| `style=1` | Colorful logger with pink/cyan/magenta theme (default) |
|
|
39
|
+
| `style=2` | Minimal simple logger with arrow prefix |
|
|
40
|
+
|
|
41
|
+
### Logger Options
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
log = Logger(
|
|
45
|
+
style=1, # 1 = ColorLogger, 2 = SimpleLogger
|
|
46
|
+
prefix="MyApp", # Prefix shown in brackets
|
|
47
|
+
github_repository="user/repo", # Displays repo info on start
|
|
48
|
+
level=LogLevel.DEBUG, # Minimum log level to display
|
|
49
|
+
log_file="logs/app.log" # Optional file logging
|
|
50
|
+
)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Log Levels
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from logfore import LogLevel
|
|
57
|
+
|
|
58
|
+
# Available levels (in order):
|
|
59
|
+
LogLevel.DEBUG
|
|
60
|
+
LogLevel.INFO
|
|
61
|
+
LogLevel.WARNING
|
|
62
|
+
LogLevel.SUCCESS
|
|
63
|
+
LogLevel.FAILURE
|
|
64
|
+
LogLevel.CRITICAL
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Timing Support
|
|
68
|
+
|
|
69
|
+
All log methods support optional timing:
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
import time
|
|
73
|
+
|
|
74
|
+
start = time.time()
|
|
75
|
+
# ... do work ...
|
|
76
|
+
end = time.time()
|
|
77
|
+
|
|
78
|
+
log.success("Done!", start=start, end=end)
|
|
79
|
+
# Output: ... [Success] -> Done! In 1.234 Seconds
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Loading Spinner
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
from logfore import Loader
|
|
86
|
+
|
|
87
|
+
# As context manager
|
|
88
|
+
with Loader(prefix="MyApp", desc="Processing...", end="Done!"):
|
|
89
|
+
time.sleep(2)
|
|
90
|
+
|
|
91
|
+
# Manual control
|
|
92
|
+
loader = Loader(desc="Loading...")
|
|
93
|
+
loader.start()
|
|
94
|
+
# ... do work ...
|
|
95
|
+
loader.stop()
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### ASCII Banner (Home Screen)
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from logfore import Home
|
|
102
|
+
|
|
103
|
+
home = Home(
|
|
104
|
+
text="LOGFORE",
|
|
105
|
+
align="center", # "left", "center", "right"
|
|
106
|
+
adinfo1="v1.0.0",
|
|
107
|
+
adinfo2="by Author",
|
|
108
|
+
credits="GitHub: user",
|
|
109
|
+
clear=True # Clear terminal before display
|
|
110
|
+
)
|
|
111
|
+
home.display()
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Auto Updater
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
from logfore import AutoUpdater, Logger
|
|
118
|
+
|
|
119
|
+
log = Logger()
|
|
120
|
+
updater = AutoUpdater("your-pypi-package-name", log)
|
|
121
|
+
updater.check_for_updates()
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### File Logging
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
log = Logger(log_file="logs/myapp.log")
|
|
128
|
+
log.info("This is saved to file too")
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Questions / Input
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
answer = log.question("What is your name? ")
|
|
135
|
+
print(f"Hello, {answer}!")
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Requirements
|
|
139
|
+
|
|
140
|
+
- Python 3.10+
|
|
141
|
+
- colorama
|
|
142
|
+
- pystyle
|
|
143
|
+
- requests
|
|
144
|
+
- packaging
|