cse-logger 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.
@@ -0,0 +1,66 @@
1
+ Metadata-Version: 2.4
2
+ Name: cse_logger
3
+ Version: 1.0.0
4
+ Summary: A nonchalant, aesthetic logger, made by CSE development.
5
+ Home-page: https://discord.gg/cse
6
+ Author: @ryze.xzy | @ryugabalwani
7
+ Description-Content-Type: text/markdown
8
+ Dynamic: author
9
+ Dynamic: description
10
+ Dynamic: description-content-type
11
+ Dynamic: home-page
12
+ Dynamic: summary
13
+
14
+ # cse_logger 🌌
15
+
16
+ a nonchalant, highly aesthetic logger for python. no noise, just vibes.
17
+ made by the cse development team.
18
+
19
+ ## installation
20
+
21
+ ```bash
22
+ pip install cse_logger
23
+ ```
24
+
25
+ ## quick start
26
+
27
+ just import and use it. it comes with a built-in aesthetic ascii banner and clean, colorful log levels straight out of the box.
28
+
29
+ ```python
30
+ import time
31
+ from cse_logger import Logger
32
+
33
+ if __name__ == "__main__":
34
+ log = Logger(name="nexus")
35
+
36
+ log.sys("initializing core routines")
37
+ time.sleep(0.2)
38
+ log.info("binding to local interface")
39
+ time.sleep(0.1)
40
+ log.trace("loaded module: astrodynamics")
41
+ log.trace("loaded module: cybernetics")
42
+ time.sleep(0.3)
43
+ log.success("all systems nominal")
44
+ log.warn("memory fragmentation detected, auto-defrag queued")
45
+ time.sleep(0.1)
46
+ log.error("unauthorized access attempt dropped")
47
+ log.info("standing by.")
48
+ ```
49
+
50
+ ## log levels
51
+
52
+ - `log.sys()`: autonomous/system level events (magenta)
53
+ - `log.info()`: standard information (cyan)
54
+ - `log.success()`: successful operations (green)
55
+ - `log.warn()`: warnings (yellow)
56
+ - `log.error()`: errors (red)
57
+ - `log.trace()`: very subtle, barely there (dim gray)
58
+
59
+ ## community
60
+
61
+ join us at [discord.gg/cse](https://discord.gg/cse).
62
+
63
+ created by **@ryze.xzy** | **@ryugabalwani**
64
+
65
+ ---
66
+ [![Discord Presence](https://lanyard.cnrad.dev/api/1420036436505268244?theme=dark&bg=1a1a2e&borderRadius=10px&idleMessage=probably+cooking+something)](https://discord.com/users/1420036436505268244)
@@ -0,0 +1,53 @@
1
+ # cse_logger 🌌
2
+
3
+ a nonchalant, highly aesthetic logger for python. no noise, just vibes.
4
+ made by the cse development team.
5
+
6
+ ## installation
7
+
8
+ ```bash
9
+ pip install cse_logger
10
+ ```
11
+
12
+ ## quick start
13
+
14
+ just import and use it. it comes with a built-in aesthetic ascii banner and clean, colorful log levels straight out of the box.
15
+
16
+ ```python
17
+ import time
18
+ from cse_logger import Logger
19
+
20
+ if __name__ == "__main__":
21
+ log = Logger(name="nexus")
22
+
23
+ log.sys("initializing core routines")
24
+ time.sleep(0.2)
25
+ log.info("binding to local interface")
26
+ time.sleep(0.1)
27
+ log.trace("loaded module: astrodynamics")
28
+ log.trace("loaded module: cybernetics")
29
+ time.sleep(0.3)
30
+ log.success("all systems nominal")
31
+ log.warn("memory fragmentation detected, auto-defrag queued")
32
+ time.sleep(0.1)
33
+ log.error("unauthorized access attempt dropped")
34
+ log.info("standing by.")
35
+ ```
36
+
37
+ ## log levels
38
+
39
+ - `log.sys()`: autonomous/system level events (magenta)
40
+ - `log.info()`: standard information (cyan)
41
+ - `log.success()`: successful operations (green)
42
+ - `log.warn()`: warnings (yellow)
43
+ - `log.error()`: errors (red)
44
+ - `log.trace()`: very subtle, barely there (dim gray)
45
+
46
+ ## community
47
+
48
+ join us at [discord.gg/cse](https://discord.gg/cse).
49
+
50
+ created by **@ryze.xzy** | **@ryugabalwani**
51
+
52
+ ---
53
+ [![Discord Presence](https://lanyard.cnrad.dev/api/1420036436505268244?theme=dark&bg=1a1a2e&borderRadius=10px&idleMessage=probably+cooking+something)](https://discord.com/users/1420036436505268244)
@@ -0,0 +1,3 @@
1
+ from .logger import Logger
2
+
3
+ __all__ = ["Logger"]
@@ -0,0 +1,70 @@
1
+ import sys
2
+ from datetime import datetime
3
+ from threading import Lock
4
+
5
+ class Logger:
6
+ RESET = "\033[0m"
7
+ BOLD = "\033[1m"
8
+ DIM = "\033[2m"
9
+ ITALIC = "\033[3m"
10
+ CYAN = "\033[36m"
11
+ MAGENTA = "\033[35m"
12
+ BLUE = "\033[34m"
13
+ YELLOW = "\033[33m"
14
+ RED = "\033[31m"
15
+ GREEN = "\033[32m"
16
+ WHITE = "\033[37m"
17
+ GRAY = "\033[90m"
18
+
19
+ DEFAULT_BANNER = r"""
20
+ ____ _ ____ __ ______ _____ ______
21
+ / __ `/ / __ `/ / / / ____/ / ___/ / ____/
22
+ _ / /_/ / / /_/ / / / / / \__ \ / __/
23
+ (_) \__, / \__, / / / / /___ ___/ / / /___
24
+ /____/ /____/ /_/ \____/ /____/ /_____/
25
+ """
26
+
27
+ def __init__(self, name="sys", banner=DEFAULT_BANNER):
28
+ self.name = name
29
+ self.lock = Lock()
30
+
31
+ if banner:
32
+ self._print_banner(banner)
33
+
34
+ def _print_banner(self, banner):
35
+ print(f"{self.BOLD}{self.MAGENTA}{banner}{self.RESET}")
36
+ print(f"{self.DIM}{self.GRAY}@ryze.xzy | @ryugabalwani | .gg/cse{self.RESET}\n")
37
+
38
+ def _get_timestamp(self):
39
+ return f"{self.DIM}{self.GRAY}{datetime.now().strftime('%H:%M:%S.%f')[:-3]}{self.RESET}"
40
+
41
+ def _format_msg(self, level_color, level_name, msg):
42
+ ts = self._get_timestamp()
43
+ prefix = f"{level_color}{self.BOLD}{level_name.ljust(5)}{self.RESET}"
44
+ return f"{ts} {prefix} {msg}"
45
+
46
+ def _log(self, level_color, level_name, msg):
47
+ with self.lock:
48
+ formatted = self._format_msg(level_color, level_name, msg)
49
+ sys.stdout.write(formatted + "\n")
50
+ sys.stdout.flush()
51
+
52
+ def info(self, msg):
53
+ self._log(self.CYAN, "info", msg)
54
+
55
+ def warn(self, msg):
56
+ self._log(self.YELLOW, "warn", msg)
57
+
58
+ def error(self, msg):
59
+ self._log(self.RED, "err", msg)
60
+
61
+ def success(self, msg):
62
+ self._log(self.GREEN, "ok", msg)
63
+
64
+ def sys(self, msg):
65
+ self._log(self.MAGENTA, "sys", msg)
66
+
67
+ def trace(self, msg):
68
+ self._log(self.GRAY, "trace", f"{self.DIM}{msg}{self.RESET}")
69
+
70
+
@@ -0,0 +1,66 @@
1
+ Metadata-Version: 2.4
2
+ Name: cse_logger
3
+ Version: 1.0.0
4
+ Summary: A nonchalant, aesthetic logger, made by CSE development.
5
+ Home-page: https://discord.gg/cse
6
+ Author: @ryze.xzy | @ryugabalwani
7
+ Description-Content-Type: text/markdown
8
+ Dynamic: author
9
+ Dynamic: description
10
+ Dynamic: description-content-type
11
+ Dynamic: home-page
12
+ Dynamic: summary
13
+
14
+ # cse_logger 🌌
15
+
16
+ a nonchalant, highly aesthetic logger for python. no noise, just vibes.
17
+ made by the cse development team.
18
+
19
+ ## installation
20
+
21
+ ```bash
22
+ pip install cse_logger
23
+ ```
24
+
25
+ ## quick start
26
+
27
+ just import and use it. it comes with a built-in aesthetic ascii banner and clean, colorful log levels straight out of the box.
28
+
29
+ ```python
30
+ import time
31
+ from cse_logger import Logger
32
+
33
+ if __name__ == "__main__":
34
+ log = Logger(name="nexus")
35
+
36
+ log.sys("initializing core routines")
37
+ time.sleep(0.2)
38
+ log.info("binding to local interface")
39
+ time.sleep(0.1)
40
+ log.trace("loaded module: astrodynamics")
41
+ log.trace("loaded module: cybernetics")
42
+ time.sleep(0.3)
43
+ log.success("all systems nominal")
44
+ log.warn("memory fragmentation detected, auto-defrag queued")
45
+ time.sleep(0.1)
46
+ log.error("unauthorized access attempt dropped")
47
+ log.info("standing by.")
48
+ ```
49
+
50
+ ## log levels
51
+
52
+ - `log.sys()`: autonomous/system level events (magenta)
53
+ - `log.info()`: standard information (cyan)
54
+ - `log.success()`: successful operations (green)
55
+ - `log.warn()`: warnings (yellow)
56
+ - `log.error()`: errors (red)
57
+ - `log.trace()`: very subtle, barely there (dim gray)
58
+
59
+ ## community
60
+
61
+ join us at [discord.gg/cse](https://discord.gg/cse).
62
+
63
+ created by **@ryze.xzy** | **@ryugabalwani**
64
+
65
+ ---
66
+ [![Discord Presence](https://lanyard.cnrad.dev/api/1420036436505268244?theme=dark&bg=1a1a2e&borderRadius=10px&idleMessage=probably+cooking+something)](https://discord.com/users/1420036436505268244)
@@ -0,0 +1,8 @@
1
+ README.md
2
+ setup.py
3
+ cse_logger/__init__.py
4
+ cse_logger/logger.py
5
+ cse_logger.egg-info/PKG-INFO
6
+ cse_logger.egg-info/SOURCES.txt
7
+ cse_logger.egg-info/dependency_links.txt
8
+ cse_logger.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ cse_logger
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,16 @@
1
+ from setuptools import setup, find_packages
2
+ from pathlib import Path
3
+
4
+ this_directory = Path(__file__).parent
5
+ long_description = (this_directory / "README.md").read_text(encoding="utf-8")
6
+
7
+ setup(
8
+ name="cse_logger",
9
+ version="1.0.0",
10
+ packages=find_packages(),
11
+ description="A nonchalant, aesthetic logger, made by CSE development.",
12
+ long_description=long_description,
13
+ long_description_content_type="text/markdown",
14
+ author="@ryze.xzy | @ryugabalwani",
15
+ url="https://discord.gg/cse",
16
+ )