Skip to content

Commit

Permalink
added logging
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonzorn committed Jan 9, 2024
1 parent 4cc72d4 commit 93dc0ea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
/keys.py
/package
*.pyc
*.log
.dmypy.json
3 changes: 3 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import sys
import time
from pathlib import Path
Expand Down Expand Up @@ -65,6 +66,8 @@ def closeEvent(self, event):


if __name__ == "__main__":
if "debug" in sys.argv:
logging.basicConfig(level=logging.WARNING, filename="latest.log", filemode="w")
QApplication.setHighDpiScaleFactorRoundingPolicy(Qt.HighDpiScaleFactorRoundingPolicy.RoundPreferFloor)
QApplication.setStyle("Fusion")
QThreadPool.globalInstance().setMaxThreadCount(32)
Expand Down
4 changes: 3 additions & 1 deletion nlightreader/consts/enums.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from enum import Enum, unique

lib_lists_en = (
Expand Down Expand Up @@ -62,7 +63,8 @@ def from_str(cls, string: str | None):
return cls.comics
if string is None or string in ("undefined", "Другое"):
return cls.undefined
raise ValueError(f"unknown manga kind: {string}")
logging.warning(f"Unknown manga kind: {string}")
return cls.undefined

@unique
class LibList(Enum):
Expand Down
1 change: 0 additions & 1 deletion nlightreader/items/manga_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def kind(self):
def kind(self, kind):
if not isinstance(kind, Nl.MangaKind):
raise TypeError("Kind must be Nl.MangaKind")
print(f"{self.name}:", kind)
self._kind = kind

def get_description(self) -> str:
Expand Down

0 comments on commit 93dc0ea

Please sign in to comment.