3 Commits 3d03c1ad9b ... 7fe407d3be

Auteur SHA1 Message Date
  Cixo Develop 7fe407d3be Add some fixes. il y a 1 semaine
  Cixo Develop 0fcc9a6ca6 Add some fixes. il y a 1 semaine
  Cixo Develop 2465b1ab67 Add some fixes. il y a 1 semaine

+ 4 - 0
.gitignore

@@ -1,3 +1,7 @@
+# ---> Logs
+*.log
+logs/
+
 # ---> Python
 # Byte-compiled / optimized / DLL files
 __pycache__/

+ 40 - 1
README.md

@@ -1,3 +1,42 @@
 # cx-logger
 
-This is simple thread-safe logger for Python.
+That is really easy to use automatic logger. To start using it in app just
+install it.
+
+```bash
+pip install cx-logger
+```
+
+When library had been installed, import it. All code snippets above would use that import.
+
+```python
+import cx_logger as logger
+```
+
+How create log directory? That is really simple, just type.
+
+```python
+import cx_logger as logger
+import pathlib
+
+manager = logger.logs_manager(pathlib.Path("./logs"))
+logging = manager.get_logger(logger.sync_logger)
+
+logging.use_handler(logger.stderr_handler())
+
+logging.info("That is only info.")
+logging.warning("Oh, that's warning!!!")
+```
+
+After that operation You would see something like that in stderr.
+
+```
+[info] 2025-10-23 14:12:12 That is only info.
+[warning] 2025-10-23 14:12:12 Oh, that's warning!!!
+```
+
+Directory ./logs would be created if not already exists, and in it You
+would see somethind like "2025-10-23-1.log". When You run script twice, then second file would be named like "2025-10-23-2.log".
+
+### More info
+ * See in the [wiki](https://git.cixoelectronic.pl/cixo-electronic/cx-logger/wiki/_pages)

+ 43 - 0
pyproject.toml

@@ -0,0 +1,43 @@
+[build-system]
+requires = [ "setuptools >= 77.0.3" ]
+build-backend = "setuptools.build_meta"
+
+[tool.setuptools.packages.find]
+where = [ "source" ]
+
+[project]
+name = "cx-logger"
+version = "2025.10.23-1"
+requires-python = ">= 3.7"
+
+readme = "README.md"
+description = "That is simple logger library, that can manage logs dir."
+
+license = "MIT"
+license-files = [ "LICENSE" ]
+
+keywords = [ 
+    "logger", "simple", "base", "logging", "safety", "web app",
+    "server app", "app", "logs", "log"
+]
+
+authors = [
+    { name = "Cixo", email = "[email protected]" }
+]
+
+maintainers = [
+    { name = "Cixo", email = "[email protected]" }
+]
+
+classifiers = [
+    "Development Status :: 5 - Production/Stable",
+    "Intended Audience :: Developers",
+    "Topic :: Software Development :: Libraries",
+    "Programming Language :: Python :: 3",
+]
+
+[project.urls]
+Homepage = "https://git.cixoelectronic.pl/cixo-electronic/cx-logger"
+Repository = "https://git.cixoelectronic.pl/cixo-electronic/cx-logger"
+Documentation = "https://git.cixoelectronic.pl/cixo-electronic/cx-logger/wiki/Quickstart"
+Issues = "https://git.cixoelectronic.pl/cixo-electronic/cx-logger/issues"

+ 0 - 0
source/__init__.py → source/cx_logger/__init__.py


+ 0 - 0
source/async_logger.py → source/cx_logger/async_logger.py


+ 0 - 0
source/file_handler.py → source/cx_logger/file_handler.py


+ 0 - 0
source/handler.py → source/cx_logger/handler.py


+ 0 - 0
source/levels.py → source/cx_logger/levels.py


+ 1 - 1
source/logger.py → source/cx_logger/logger.py

@@ -76,7 +76,7 @@ class logger:
             Current time as timestamp.
         """
 
-        return time.strftime("%Y-%m-%d %H:%M:%S")
+        return "(" + time.strftime("%Y-%m-%d %H:%M:%S") + ")"
 
     def __level_name(self, level: levels) -> str:
         """

+ 1 - 1
source/logs_manager.py → source/cx_logger/logs_manager.py

@@ -129,7 +129,7 @@ class logs_manager:
 
         while True:
             result_name = (
-                base_name + "-" + \
+                base_name + "." + \
                 str(name_count + 1) + ".log" \
             )
 

+ 0 - 0
source/stderr_handler.py → source/cx_logger/stderr_handler.py


+ 0 - 0
source/stdout_handler.py → source/cx_logger/stdout_handler.py


+ 0 - 0
source/sync_logger.py → source/cx_logger/sync_logger.py