hexlogger 1.0.0__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.
- hexlogger-1.0.0/LICENSE +21 -0
- hexlogger-1.0.0/PKG-INFO +266 -0
- hexlogger-1.0.0/README.md +239 -0
- hexlogger-1.0.0/hexlogger/__init__.py +1069 -0
- hexlogger-1.0.0/hexlogger.egg-info/PKG-INFO +266 -0
- hexlogger-1.0.0/hexlogger.egg-info/SOURCES.txt +8 -0
- hexlogger-1.0.0/hexlogger.egg-info/dependency_links.txt +1 -0
- hexlogger-1.0.0/hexlogger.egg-info/top_level.txt +1 -0
- hexlogger-1.0.0/pyproject.toml +35 -0
- hexlogger-1.0.0/setup.cfg +4 -0
hexlogger-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Montage
|
|
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.
|
hexlogger-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hexlogger
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Premium console logging library with themes, gradients, panels, tables, progress bars, and spinners.
|
|
5
|
+
Author: Itz Montage
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Montagexd/hexlogger
|
|
8
|
+
Keywords: logging,console,terminal,colors,logger,hex,ansi
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
21
|
+
Classifier: Topic :: System :: Logging
|
|
22
|
+
Classifier: Operating System :: OS Independent
|
|
23
|
+
Requires-Python: >=3.7
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# ๐ฎ HexLogger
|
|
29
|
+
|
|
30
|
+
**Premium console logging library for Python**
|
|
31
|
+
|
|
32
|
+
A feature-rich, zero-dependency logging library with beautiful colored output, multiple themes, gradient text, panels, tables, progress bars, and spinners.
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install hexlogger
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
import hexlogger
|
|
44
|
+
|
|
45
|
+
hexlogger.debug("Connecting to server...")
|
|
46
|
+
hexlogger.success("Connected!")
|
|
47
|
+
hexlogger.info("Processing 1000 items")
|
|
48
|
+
hexlogger.warn("Rate limit approaching")
|
|
49
|
+
hexlogger.error("Connection failed")
|
|
50
|
+
hexlogger.critical("System overload!")
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Output:**
|
|
54
|
+
```
|
|
55
|
+
[-(14:30:00)-] [ โ ] DEBUG ยป Connecting to server...
|
|
56
|
+
[-(14:30:00)-] [ โ ] SUCCESS ยป Connected!
|
|
57
|
+
[-(14:30:00)-] [ โ ] INFO ยป Processing 1000 items
|
|
58
|
+
[-(14:30:00)-] [ โ ] WARNING ยป Rate limit approaching
|
|
59
|
+
[-(14:30:00)-] [ โ ] ERROR ยป Connection failed
|
|
60
|
+
[-(14:30:00)-] [ โ ] CRITICAL ยป System overload!
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Themes
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
import hexlogger
|
|
67
|
+
|
|
68
|
+
# Available themes: default, neon, minimal, hacker
|
|
69
|
+
hexlogger.set_theme("neon")
|
|
70
|
+
hexlogger.success("Neon vibes!")
|
|
71
|
+
|
|
72
|
+
hexlogger.set_theme("hacker")
|
|
73
|
+
hexlogger.success("Matrix mode!")
|
|
74
|
+
|
|
75
|
+
hexlogger.set_theme("minimal")
|
|
76
|
+
hexlogger.success("Clean and simple")
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Custom Themes
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from hexlogger import add_theme, rgb
|
|
83
|
+
|
|
84
|
+
add_theme("ocean", {
|
|
85
|
+
"timestamp": rgb(0, 100, 200),
|
|
86
|
+
"bracket": rgb(0, 80, 160),
|
|
87
|
+
"dot": rgb(0, 200, 255),
|
|
88
|
+
"separator": rgb(0, 150, 200),
|
|
89
|
+
"debug": rgb(100, 180, 255),
|
|
90
|
+
"info": rgb(0, 200, 255),
|
|
91
|
+
"success": rgb(0, 255, 200),
|
|
92
|
+
"warning": rgb(255, 200, 0),
|
|
93
|
+
"error": rgb(255, 80, 80),
|
|
94
|
+
"critical": rgb(255, 0, 50),
|
|
95
|
+
"fatal": rgb(200, 0, 0),
|
|
96
|
+
"trace": rgb(100, 150, 200),
|
|
97
|
+
"divider": rgb(0, 60, 100),
|
|
98
|
+
"label_debug": "DEBUG",
|
|
99
|
+
"label_info": "INFO",
|
|
100
|
+
"label_success": "SUCCESS",
|
|
101
|
+
"label_warning": "WARNING",
|
|
102
|
+
"label_error": "ERROR",
|
|
103
|
+
"label_critical": "CRITICAL",
|
|
104
|
+
"label_fatal": "FATAL",
|
|
105
|
+
"label_trace": "TRACE",
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
hexlogger.set_theme("ocean")
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Dividers & Sections
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
hexlogger.divider()
|
|
115
|
+
hexlogger.section("RESULTS")
|
|
116
|
+
hexlogger.rule("Settings", char="โ")
|
|
117
|
+
hexlogger.blank(2)
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Banner
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
hexlogger.banner("HexLogger\nv1.0.0")
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
โโโโโโโโโโโโโโโโโโโโโ
|
|
128
|
+
โ HexLogger โ
|
|
129
|
+
โ v1.0.0 โ
|
|
130
|
+
โโโโโโโโโโโโโโโโโโโโโ
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Panel
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
hexlogger.panel("Server: online\nPing: 42ms\nUptime: 99.9%", title="Status")
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
โญโ Status โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
|
|
141
|
+
โ Server: online โ
|
|
142
|
+
โ Ping: 42ms โ
|
|
143
|
+
โ Uptime: 99.9% โ
|
|
144
|
+
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Table
|
|
148
|
+
|
|
149
|
+
```python
|
|
150
|
+
hexlogger.table(
|
|
151
|
+
headers=["Name", "Status", "Ping"],
|
|
152
|
+
rows=[
|
|
153
|
+
["Server 1", "Online", "12ms"],
|
|
154
|
+
["Server 2", "Offline", "---"],
|
|
155
|
+
["Server 3", "Online", "45ms"],
|
|
156
|
+
]
|
|
157
|
+
)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Gradient Text
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
hexlogger.gradient_print("Hello World!", (255, 0, 100), (100, 0, 255))
|
|
164
|
+
hexlogger.rainbow_print("Rainbow text!")
|
|
165
|
+
|
|
166
|
+
# Get gradient string without printing
|
|
167
|
+
text = hexlogger.gradient_text("Custom gradient", (0, 255, 200), (255, 0, 100))
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Progress Bar
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
import time
|
|
174
|
+
|
|
175
|
+
bar = hexlogger.ProgressBar(total=100, label="Downloading")
|
|
176
|
+
for i in range(100):
|
|
177
|
+
time.sleep(0.05)
|
|
178
|
+
bar.update()
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Spinner
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
import time
|
|
185
|
+
|
|
186
|
+
# As context manager
|
|
187
|
+
with hexlogger.Spinner("Loading data...", style="dots"):
|
|
188
|
+
time.sleep(3)
|
|
189
|
+
|
|
190
|
+
# Manual control
|
|
191
|
+
spinner = hexlogger.Spinner("Processing...", style="circle")
|
|
192
|
+
spinner.start()
|
|
193
|
+
time.sleep(2)
|
|
194
|
+
spinner.stop("Done!")
|
|
195
|
+
|
|
196
|
+
# Available styles: dots, line, arrow, bounce, box, circle
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Timer
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
# As context manager
|
|
203
|
+
with hexlogger.Timer("Database query"):
|
|
204
|
+
time.sleep(1.5)
|
|
205
|
+
# Output: [INFO] Database query: 1.500s
|
|
206
|
+
|
|
207
|
+
# Manual control
|
|
208
|
+
timer = hexlogger.Timer("API call")
|
|
209
|
+
timer.start()
|
|
210
|
+
# ... do work ...
|
|
211
|
+
elapsed = timer.stop()
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Key-Value Pairs
|
|
215
|
+
|
|
216
|
+
```python
|
|
217
|
+
hexlogger.pair("Server", "production-01")
|
|
218
|
+
hexlogger.pair("Status", "running")
|
|
219
|
+
hexlogger.pair("Uptime", "99.97%")
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Text Styling
|
|
223
|
+
|
|
224
|
+
```python
|
|
225
|
+
from hexlogger import bold, italic, underline, dim, strike, colorize, Colors
|
|
226
|
+
|
|
227
|
+
print(bold("Bold text"))
|
|
228
|
+
print(italic("Italic text"))
|
|
229
|
+
print(underline("Underlined"))
|
|
230
|
+
print(colorize("Custom color", Colors.CYAN))
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Configuration
|
|
234
|
+
|
|
235
|
+
```python
|
|
236
|
+
# Set time format
|
|
237
|
+
hexlogger.set_time_format("%Y-%m-%d %H:%M:%S")
|
|
238
|
+
|
|
239
|
+
# Hide timestamps
|
|
240
|
+
hexlogger.show_time(False)
|
|
241
|
+
|
|
242
|
+
# Log to file
|
|
243
|
+
hexlogger.set_log_file("app.log")
|
|
244
|
+
|
|
245
|
+
# Set minimum log level
|
|
246
|
+
hexlogger.set_min_level("warning") # Only WARNING and above
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Features
|
|
250
|
+
|
|
251
|
+
- โ
Zero dependencies
|
|
252
|
+
- โ
Beautiful colored output
|
|
253
|
+
- โ
4 built-in themes + custom themes
|
|
254
|
+
- โ
Gradient & rainbow text
|
|
255
|
+
- โ
Panels, tables, banners
|
|
256
|
+
- โ
Progress bars with ETA
|
|
257
|
+
- โ
Animated spinners (6 styles)
|
|
258
|
+
- โ
Timer utility
|
|
259
|
+
- โ
File logging
|
|
260
|
+
- โ
Thread-safe
|
|
261
|
+
- โ
Windows compatible
|
|
262
|
+
- โ
Python 3.7+
|
|
263
|
+
|
|
264
|
+
## License
|
|
265
|
+
|
|
266
|
+
MIT License - Created by Montage
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# ๐ฎ HexLogger
|
|
2
|
+
|
|
3
|
+
**Premium console logging library for Python**
|
|
4
|
+
|
|
5
|
+
A feature-rich, zero-dependency logging library with beautiful colored output, multiple themes, gradient text, panels, tables, progress bars, and spinners.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install hexlogger
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
import hexlogger
|
|
17
|
+
|
|
18
|
+
hexlogger.debug("Connecting to server...")
|
|
19
|
+
hexlogger.success("Connected!")
|
|
20
|
+
hexlogger.info("Processing 1000 items")
|
|
21
|
+
hexlogger.warn("Rate limit approaching")
|
|
22
|
+
hexlogger.error("Connection failed")
|
|
23
|
+
hexlogger.critical("System overload!")
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Output:**
|
|
27
|
+
```
|
|
28
|
+
[-(14:30:00)-] [ โ ] DEBUG ยป Connecting to server...
|
|
29
|
+
[-(14:30:00)-] [ โ ] SUCCESS ยป Connected!
|
|
30
|
+
[-(14:30:00)-] [ โ ] INFO ยป Processing 1000 items
|
|
31
|
+
[-(14:30:00)-] [ โ ] WARNING ยป Rate limit approaching
|
|
32
|
+
[-(14:30:00)-] [ โ ] ERROR ยป Connection failed
|
|
33
|
+
[-(14:30:00)-] [ โ ] CRITICAL ยป System overload!
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Themes
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
import hexlogger
|
|
40
|
+
|
|
41
|
+
# Available themes: default, neon, minimal, hacker
|
|
42
|
+
hexlogger.set_theme("neon")
|
|
43
|
+
hexlogger.success("Neon vibes!")
|
|
44
|
+
|
|
45
|
+
hexlogger.set_theme("hacker")
|
|
46
|
+
hexlogger.success("Matrix mode!")
|
|
47
|
+
|
|
48
|
+
hexlogger.set_theme("minimal")
|
|
49
|
+
hexlogger.success("Clean and simple")
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Custom Themes
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from hexlogger import add_theme, rgb
|
|
56
|
+
|
|
57
|
+
add_theme("ocean", {
|
|
58
|
+
"timestamp": rgb(0, 100, 200),
|
|
59
|
+
"bracket": rgb(0, 80, 160),
|
|
60
|
+
"dot": rgb(0, 200, 255),
|
|
61
|
+
"separator": rgb(0, 150, 200),
|
|
62
|
+
"debug": rgb(100, 180, 255),
|
|
63
|
+
"info": rgb(0, 200, 255),
|
|
64
|
+
"success": rgb(0, 255, 200),
|
|
65
|
+
"warning": rgb(255, 200, 0),
|
|
66
|
+
"error": rgb(255, 80, 80),
|
|
67
|
+
"critical": rgb(255, 0, 50),
|
|
68
|
+
"fatal": rgb(200, 0, 0),
|
|
69
|
+
"trace": rgb(100, 150, 200),
|
|
70
|
+
"divider": rgb(0, 60, 100),
|
|
71
|
+
"label_debug": "DEBUG",
|
|
72
|
+
"label_info": "INFO",
|
|
73
|
+
"label_success": "SUCCESS",
|
|
74
|
+
"label_warning": "WARNING",
|
|
75
|
+
"label_error": "ERROR",
|
|
76
|
+
"label_critical": "CRITICAL",
|
|
77
|
+
"label_fatal": "FATAL",
|
|
78
|
+
"label_trace": "TRACE",
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
hexlogger.set_theme("ocean")
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Dividers & Sections
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
hexlogger.divider()
|
|
88
|
+
hexlogger.section("RESULTS")
|
|
89
|
+
hexlogger.rule("Settings", char="โ")
|
|
90
|
+
hexlogger.blank(2)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Banner
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
hexlogger.banner("HexLogger\nv1.0.0")
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
โโโโโโโโโโโโโโโโโโโโโ
|
|
101
|
+
โ HexLogger โ
|
|
102
|
+
โ v1.0.0 โ
|
|
103
|
+
โโโโโโโโโโโโโโโโโโโโโ
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Panel
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
hexlogger.panel("Server: online\nPing: 42ms\nUptime: 99.9%", title="Status")
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
โญโ Status โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
|
|
114
|
+
โ Server: online โ
|
|
115
|
+
โ Ping: 42ms โ
|
|
116
|
+
โ Uptime: 99.9% โ
|
|
117
|
+
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Table
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
hexlogger.table(
|
|
124
|
+
headers=["Name", "Status", "Ping"],
|
|
125
|
+
rows=[
|
|
126
|
+
["Server 1", "Online", "12ms"],
|
|
127
|
+
["Server 2", "Offline", "---"],
|
|
128
|
+
["Server 3", "Online", "45ms"],
|
|
129
|
+
]
|
|
130
|
+
)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Gradient Text
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
hexlogger.gradient_print("Hello World!", (255, 0, 100), (100, 0, 255))
|
|
137
|
+
hexlogger.rainbow_print("Rainbow text!")
|
|
138
|
+
|
|
139
|
+
# Get gradient string without printing
|
|
140
|
+
text = hexlogger.gradient_text("Custom gradient", (0, 255, 200), (255, 0, 100))
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Progress Bar
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
import time
|
|
147
|
+
|
|
148
|
+
bar = hexlogger.ProgressBar(total=100, label="Downloading")
|
|
149
|
+
for i in range(100):
|
|
150
|
+
time.sleep(0.05)
|
|
151
|
+
bar.update()
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Spinner
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
import time
|
|
158
|
+
|
|
159
|
+
# As context manager
|
|
160
|
+
with hexlogger.Spinner("Loading data...", style="dots"):
|
|
161
|
+
time.sleep(3)
|
|
162
|
+
|
|
163
|
+
# Manual control
|
|
164
|
+
spinner = hexlogger.Spinner("Processing...", style="circle")
|
|
165
|
+
spinner.start()
|
|
166
|
+
time.sleep(2)
|
|
167
|
+
spinner.stop("Done!")
|
|
168
|
+
|
|
169
|
+
# Available styles: dots, line, arrow, bounce, box, circle
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Timer
|
|
173
|
+
|
|
174
|
+
```python
|
|
175
|
+
# As context manager
|
|
176
|
+
with hexlogger.Timer("Database query"):
|
|
177
|
+
time.sleep(1.5)
|
|
178
|
+
# Output: [INFO] Database query: 1.500s
|
|
179
|
+
|
|
180
|
+
# Manual control
|
|
181
|
+
timer = hexlogger.Timer("API call")
|
|
182
|
+
timer.start()
|
|
183
|
+
# ... do work ...
|
|
184
|
+
elapsed = timer.stop()
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Key-Value Pairs
|
|
188
|
+
|
|
189
|
+
```python
|
|
190
|
+
hexlogger.pair("Server", "production-01")
|
|
191
|
+
hexlogger.pair("Status", "running")
|
|
192
|
+
hexlogger.pair("Uptime", "99.97%")
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Text Styling
|
|
196
|
+
|
|
197
|
+
```python
|
|
198
|
+
from hexlogger import bold, italic, underline, dim, strike, colorize, Colors
|
|
199
|
+
|
|
200
|
+
print(bold("Bold text"))
|
|
201
|
+
print(italic("Italic text"))
|
|
202
|
+
print(underline("Underlined"))
|
|
203
|
+
print(colorize("Custom color", Colors.CYAN))
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Configuration
|
|
207
|
+
|
|
208
|
+
```python
|
|
209
|
+
# Set time format
|
|
210
|
+
hexlogger.set_time_format("%Y-%m-%d %H:%M:%S")
|
|
211
|
+
|
|
212
|
+
# Hide timestamps
|
|
213
|
+
hexlogger.show_time(False)
|
|
214
|
+
|
|
215
|
+
# Log to file
|
|
216
|
+
hexlogger.set_log_file("app.log")
|
|
217
|
+
|
|
218
|
+
# Set minimum log level
|
|
219
|
+
hexlogger.set_min_level("warning") # Only WARNING and above
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Features
|
|
223
|
+
|
|
224
|
+
- โ
Zero dependencies
|
|
225
|
+
- โ
Beautiful colored output
|
|
226
|
+
- โ
4 built-in themes + custom themes
|
|
227
|
+
- โ
Gradient & rainbow text
|
|
228
|
+
- โ
Panels, tables, banners
|
|
229
|
+
- โ
Progress bars with ETA
|
|
230
|
+
- โ
Animated spinners (6 styles)
|
|
231
|
+
- โ
Timer utility
|
|
232
|
+
- โ
File logging
|
|
233
|
+
- โ
Thread-safe
|
|
234
|
+
- โ
Windows compatible
|
|
235
|
+
- โ
Python 3.7+
|
|
236
|
+
|
|
237
|
+
## License
|
|
238
|
+
|
|
239
|
+
MIT License - Created by Montage
|