lyrpy 1.0.0__py3-none-any.whl → 2024.0.1__py3-none-any.whl

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.

Potentially problematic release.


This version of lyrpy might be problematic. Click here for more details.

Files changed (47) hide show
  1. {SRC/LIB/lyrpy → lyr}/LUConsole.py +1 -1
  2. lyr/LUConst.py +45 -0
  3. {SRC/LIB/lyrpy → lyr}/LUDateTime.py +4 -2
  4. {SRC/LIB/lyrpy → lyr}/LUDecotators.py +3 -2
  5. {SRC/LIB/lyrpy → lyr}/LUDict.py +1 -0
  6. {SRC/LIB/lyrpy → lyr}/LUDoc.py +4 -5
  7. {SRC/LIB/lyrpy → lyr}/LUErrors.py +1 -0
  8. {SRC/LIB/lyrpy → lyr}/LUFile.py +66 -120
  9. {SRC/LIB/lyrpy → lyr}/LUFileUtils.py +45 -60
  10. {SRC/LIB/lyrpy → lyr}/LULog.py +232 -307
  11. {SRC/LIB/lyrpy → lyr}/LUObjects.py +4 -4
  12. {SRC/LIB/lyrpy → lyr}/LUObjectsYT.py +22 -39
  13. {SRC/LIB/lyrpy → lyr}/LUParserARG.py +3 -2
  14. {SRC/LIB/lyrpy → lyr}/LUParserINI.py +9 -14
  15. {SRC/LIB/lyrpy → lyr}/LUParserREG.py +1 -5
  16. {SRC/LIB/lyrpy → lyr}/LUQThread.py +4 -6
  17. {SRC/LIB/lyrpy → lyr}/LUQTimer.py +5 -5
  18. {SRC/LIB/lyrpy → lyr}/LUSheduler.py +23 -24
  19. {SRC/LIB/lyrpy → lyr}/LUThread.py +6 -7
  20. {SRC/LIB/lyrpy → lyr}/LUTimer.py +3 -5
  21. {SRC/LIB/lyrpy → lyr}/LUVersion.py +1 -4
  22. {SRC/LIB/lyrpy → lyr}/LUYouTube.py +7 -6
  23. {SRC/LIB/lyrpy → lyr}/LUos.py +5 -15
  24. {SRC/LIB/lyrpy → lyr}/__init__.py +2 -2
  25. {SRC/LIB/lyrpy → lyr}/__main__.py +19 -20
  26. lyrpy-2024.0.1.data/data/data/text.txt +1 -0
  27. lyrpy-2024.0.1.dist-info/METADATA +43 -0
  28. lyrpy-2024.0.1.dist-info/RECORD +38 -0
  29. {lyrpy-1.0.0.dist-info → lyrpy-2024.0.1.dist-info}/WHEEL +1 -1
  30. lyrpy-2024.0.1.dist-info/top_level.txt +1 -0
  31. SRC/LIB/__init__.py +0 -0
  32. SRC/LIB/lyrpy/LUConst.py +0 -358
  33. SRC/LIB/lyrpy/LUTelegram.py +0 -428
  34. SRC/__init__.py +0 -0
  35. TESTS/__init__.py +0 -0
  36. TESTS/test_main.py +0 -10
  37. lyrpy-1.0.0.dist-info/METADATA +0 -24
  38. lyrpy-1.0.0.dist-info/RECORD +0 -42
  39. lyrpy-1.0.0.dist-info/top_level.txt +0 -2
  40. {SRC/LIB/lyrpy → lyr}/LUNetwork.py +0 -0
  41. {SRC/LIB/lyrpy → lyr}/LUNumUtils.py +0 -0
  42. {SRC/LIB/lyrpy → lyr}/LUProc.py +0 -0
  43. {SRC/LIB/lyrpy → lyr}/LUStrDecode.py +0 -0
  44. {SRC/LIB/lyrpy → lyr}/LUStrUtils.py +0 -0
  45. {SRC/LIB/lyrpy → lyr}/LUSupport.py +0 -0
  46. {SRC/LIB/lyrpy → lyr}/LUsys.py +0 -0
  47. {lyrpy-1.0.0.dist-info/licenses → lyrpy-2024.0.1.dist-info}/LICENSE +0 -0
@@ -26,7 +26,6 @@ import logging
26
26
  import logging.config
27
27
  import yaml
28
28
  import json
29
- import shutil
30
29
 
31
30
  import inspect
32
31
  import traceback
@@ -42,22 +41,25 @@ import PySide6.QtWidgets
42
41
  #------------------------------------------
43
42
  # БИБЛИОТЕКА LU
44
43
  #------------------------------------------
45
- import lyrpy.LUConst as LUConst
46
- import lyrpy.LUFile as LUFile
47
- import lyrpy.LUConsole as LUConsole
48
- import lyrpy.LUDateTime as LUDateTime
49
- import lyrpy.LUos as LUos
50
- import lyrpy.LUParserINI as LUParserINI
51
- import lyrpy.LUDict as LUDict
52
- import lyrpy.LUSupport as LUSupport
44
+ import lyr
45
+ import lyr.LUConst as LUConst
46
+ import lyr.LUFile as LUFile
47
+ import lyr.LUConsole as LUConsole
48
+ import lyr.LUDateTime as LUDateTime
49
+ import lyr.LUos as LUos
50
+ import lyr.LUParserINI as LUParserINI
51
+ import lyr.LUDict as LUDict
52
+ import lyr.LUSupport as LUSupport
53
53
 
54
+ # ===========================================================================
55
+ # CONST
56
+ # ===========================================================================
54
57
  import rich
55
58
  import rich.console as console
56
59
  GConsoleRich = rich.console.Console ()
57
60
 
58
- # ===========================================================================
59
- # CONST
60
- # ===========================================================================
61
+ STATLogging = True
62
+
61
63
  """CONST"""
62
64
  ctlsNOTSET = ' '
63
65
  ctlsDEBUG = 'D'
@@ -107,7 +109,6 @@ def AddLevelName():
107
109
  #endfunction
108
110
 
109
111
  CDefaultFileLogINI = 'logging.ini'
110
- CDefaultFileLogINI_CONSOLE = 'logging_CONSOLE.INI'
111
112
  CDefaultFileLogCONFIG = 'logging.CONFIG'
112
113
  CDefaultFileLogYAML = 'logging.YAML'
113
114
 
@@ -188,17 +189,17 @@ Cbold_red_blue = Cbold+Cred+' on '+Cblue
188
189
  Cbold_green = Cbold+Cred
189
190
 
190
191
  COLORS_tls = {
191
- TTypeLogString.tlsNOTSET: LUConsole.cFG8_BLUE + LUConsole.sEND,
192
- TTypeLogString.tlsDEBUG: LUConsole.cFG8_BLUE + LUConsole.sEND,
193
- TTypeLogString.tlsINFO: LUConsole.cFG8_WHITE + LUConsole.sEND,
194
- TTypeLogString.tlsWARNING: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_YELLOW + LUConsole.sEND,
195
- TTypeLogString.tlsERROR: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_RED + LUConsole.sEND,
196
- TTypeLogString.tlsCRITICAL: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_BLACK + ';' + LUConsole.cBG8_RED + LUConsole.sEND,
197
- TTypeLogString.tlsBEGIN: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_GREEN + LUConsole.sEND,
198
- TTypeLogString.tlsEND: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_GREEN + LUConsole.sEND,
199
- TTypeLogString.tlsPROCESS: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_GREEN + LUConsole.sEND,
200
- TTypeLogString.tlsDEBUGTEXT: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_BLUE + LUConsole.sEND,
201
- TTypeLogString.tlsTEXT: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_YELLOW + LUConsole.sEND
192
+ TTypeLogString.tlsNOTSET: lyr.LUConsole.cFG8_BLUE+lyr.LUConsole.sEND,
193
+ TTypeLogString.tlsDEBUG: lyr.LUConsole.cFG8_BLUE+lyr.LUConsole.sEND,
194
+ TTypeLogString.tlsINFO: lyr.LUConsole.cFG8_WHITE+lyr.LUConsole.sEND,
195
+ TTypeLogString.tlsWARNING: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_YELLOW+lyr.LUConsole.sEND,
196
+ TTypeLogString.tlsERROR: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_RED+lyr.LUConsole.sEND,
197
+ TTypeLogString.tlsCRITICAL: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_BLACK + ';' + lyr.LUConsole.cBG8_RED+lyr.LUConsole.sEND,
198
+ TTypeLogString.tlsBEGIN: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_GREEN + lyr.LUConsole.sEND,
199
+ TTypeLogString.tlsEND: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_GREEN + lyr.LUConsole.sEND,
200
+ TTypeLogString.tlsPROCESS: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_GREEN + lyr.LUConsole.sEND,
201
+ TTypeLogString.tlsDEBUGTEXT: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_BLUE+lyr.LUConsole.sEND,
202
+ TTypeLogString.tlsTEXT: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_YELLOW+lyr.LUConsole.sEND
202
203
  }
203
204
 
204
205
  COLORS_tls_rich = {
@@ -216,17 +217,17 @@ COLORS_tls_rich = {
216
217
  }
217
218
 
218
219
  COLORS = {
219
- logging.NOTSET: LUConsole.cFG8_BLUE + LUConsole.sEND,
220
- logging.DEBUG: LUConsole.cFG8_BLUE + LUConsole.sEND,
221
- logging.INFO: LUConsole.cFG8_WHITE + LUConsole.sEND,
222
- logging.WARNING: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_YELLOW + LUConsole.sEND,
223
- logging.ERROR: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_RED + LUConsole.sEND,
224
- logging.CRITICAL: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_BLACK + ';' + LUConsole.cBG8_RED + LUConsole.sEND,
225
- BEGIN: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_GREEN + LUConsole.sEND,
226
- END: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_GREEN + LUConsole.sEND,
227
- PROCESS: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_GREEN + LUConsole.sEND,
228
- DEBUGTEXT: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_BLUE + LUConsole.sEND,
229
- TEXT: LUConsole.cS_BOLD + ';' + LUConsole.cFG8_YELLOW + LUConsole.sEND
220
+ logging.NOTSET: lyr.LUConsole.cFG8_BLUE+lyr.LUConsole.sEND,
221
+ logging.DEBUG: lyr.LUConsole.cFG8_BLUE+lyr.LUConsole.sEND,
222
+ logging.INFO: lyr.LUConsole.cFG8_WHITE+lyr.LUConsole.sEND,
223
+ logging.WARNING: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_YELLOW+lyr.LUConsole.sEND,
224
+ logging.ERROR: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_RED+lyr.LUConsole.sEND,
225
+ logging.CRITICAL: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_BLACK + ';' + lyr.LUConsole.cBG8_RED+lyr.LUConsole.sEND,
226
+ BEGIN: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_GREEN + lyr.LUConsole.sEND,
227
+ END: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_GREEN + lyr.LUConsole.sEND,
228
+ PROCESS: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_GREEN + lyr.LUConsole.sEND,
229
+ DEBUGTEXT: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_BLUE+lyr.LUConsole.sEND,
230
+ TEXT: lyr.LUConsole.cS_BOLD + ';' + lyr.LUConsole.cFG8_YELLOW+lyr.LUConsole.sEND
230
231
  }
231
232
 
232
233
  COLORS_rich = {
@@ -267,7 +268,7 @@ class TFileMemoLog (object):
267
268
  self.__FMemoLog = None #TMemo
268
269
  self.__FLogStrings: list = list() #TStringList;
269
270
  self.__FLogSave: list = list() #TStringList;
270
- self.__FLogCODE = LUFile.cDefaultEncoding
271
+ self.__FLogCODE = lyr.LUFile.cDefaultEncoding
271
272
  self.__FConsoleRich = rich.console.Console()
272
273
 
273
274
  # self.__FLogger: logging.Logger = CreateLoggerFILEINI (CDefaultFileLogINI, 'root')
@@ -283,9 +284,9 @@ class TFileMemoLog (object):
283
284
  #beginfunction
284
285
  del self.__FLogStrings
285
286
  del self.__FLogSave
286
- # LClassName = self.__class__.__name__
287
- # s = '{} уничтожен'.format (LClassName)
288
- # print (s)
287
+ LClassName = self.__class__.__name__
288
+ s = '{} уничтожен'.format (LClassName)
289
+ #print (s)
289
290
  #endfunction
290
291
 
291
292
  def Clear(self):
@@ -461,7 +462,7 @@ class TFileMemoLog (object):
461
462
  #endfor
462
463
  except:
463
464
  s = f'TruncateLog: Неправильная кодировка журнала!'
464
- LoggerTOOLS.error(s)
465
+ LoggerTOOLS.error (s)
465
466
  finally:
466
467
  LFile.close ()
467
468
  # TruncateMemo (ts)
@@ -497,7 +498,7 @@ class TFileMemoLog (object):
497
498
  _s = s
498
499
  else:
499
500
  _s = self._LogDateStr (False) + ' ' + str(T.value) + ' ' + s
500
- if not LUSupport.IsTerminal ():
501
+ if not LUSupport.ISTerminal ():
501
502
  LCOLOR = COLORS_tls.get (T)
502
503
  if LCOLOR is not None:
503
504
  LFmt = LUConsole.sBEGIN_oct + LCOLOR + _s + LUConsole.sRESET
@@ -594,7 +595,6 @@ class TFileMemoLog (object):
594
595
  self.__FLogStringAnsi = Value
595
596
  if self.LogEnabled:
596
597
  self._Execute(T)
597
- #endif
598
598
  #endfunction
599
599
 
600
600
  def AddLogFile (self, AFileName: str):
@@ -604,7 +604,6 @@ class TFileMemoLog (object):
604
604
  LEncoding = LUFile.GetFileEncoding (AFileName)
605
605
  if LEncoding == '':
606
606
  LEncoding = LUFile.cDefaultEncoding
607
- #endif
608
607
  try:
609
608
  # работа с файлом
610
609
  with open (AFileName, 'r', encoding = LEncoding) as LFile:
@@ -616,7 +615,7 @@ class TFileMemoLog (object):
616
615
  self.AddLog (TTypeLogString.tlsERROR, AFileName)
617
616
  s = f'AddLogFile: Неправильная кодировка журнала!'
618
617
  LoggerTOOLS.error (s)
619
- #endtry
618
+
620
619
  #endif
621
620
  #endfunction
622
621
  #endclass
@@ -754,7 +753,7 @@ class TStreamHandler(logging.StreamHandler):
754
753
  msg = self.format(record)
755
754
  stream = self.stream
756
755
  # issue 35046: merged two stream.writes into one.
757
- if not LUSupport.IsTerminal ():
756
+ if not lyr.LUSupport.IsTerminal ():
758
757
  stream.write(msg + self.terminator)
759
758
  self.flush()
760
759
  else:
@@ -895,9 +894,9 @@ class TFormatter(logging.Formatter):
895
894
  """_SetColor"""
896
895
  #beginfunction
897
896
  if self.FUseColor:
898
- if not LUSupport.IsTerminal ():
897
+ if not lyr.LUSupport.IsTerminal ():
899
898
  LCOLOR = COLORS.get (ALevelNo)
900
- LFmt = LUConsole.sBEGIN_oct + LCOLOR + AFmt + LUConsole.sRESET
899
+ LFmt = lyr.LUConsole.sBEGIN_oct + LCOLOR + AFmt + lyr.LUConsole.sRESET
901
900
  return LFmt
902
901
  else:
903
902
  LCOLOR = COLORS_rich.get (ALevelNo)
@@ -909,7 +908,6 @@ class TFormatter(logging.Formatter):
909
908
  else:
910
909
  LFmt = _s
911
910
  return LFmt
912
- #endif
913
911
  else:
914
912
  return AFmt
915
913
  #endif
@@ -1414,7 +1412,7 @@ def LogFileName(ALog: int, ALogDir: str, ALogFile: str) -> str:
1414
1412
  s = LUDateTime.DateTimeStr (False, LToday, LUDateTime.cFormatDateYYMMDD_01, False)
1415
1413
  LLogFile = s+'.log'
1416
1414
  #endif
1417
- LLogFileName = os.path.join(LLogDir, LLogFile)
1415
+ LLogFileName = s.path.join([LLogDir, LLogFile])
1418
1416
  if ALog == 10 or ALog == 30:
1419
1417
  if LUFile.FileExists(LLogFileName):
1420
1418
  try:
@@ -1442,7 +1440,7 @@ def LogAdd (ALog: int, ALogFile: str, AOpt: TTypeLogString, AMessage: str):
1442
1440
 
1443
1441
  def _WriteConsole(_s, T):
1444
1442
  #beginfunction
1445
- if not LUSupport.IsTerminal ():
1443
+ if not LUSupport.ISTerminal ():
1446
1444
  LCOLOR = COLORS_tls.get (T)
1447
1445
  if LCOLOR is not None:
1448
1446
  LFmt = LUConsole.sBEGIN_oct + LCOLOR + _s + LUConsole.sRESET
@@ -1572,7 +1570,7 @@ def GetHandler (ALogger: logging.Logger, ANameHandler: str):
1572
1570
  """Printhandlers"""
1573
1571
  #beginfunction
1574
1572
  for item in ALogger.root.handlers:
1575
- # s = f'{item.name}={item}'
1573
+ s = f'{item.name}={item}'
1576
1574
  # LoggerTOOLS.info(s)
1577
1575
  if item.name == ANameHandler:
1578
1576
  return item
@@ -1596,7 +1594,6 @@ def WinToUnix (Astr: str) -> str:
1596
1594
  # print ('INFO: Only LINUX or WINDOWS')
1597
1595
  Lstr = Astr
1598
1596
  #endmatch
1599
- return Lstr
1600
1597
  #endfunction
1601
1598
 
1602
1599
  #-------------------------------------------------
@@ -1681,9 +1678,6 @@ def CreateLoggerCONFIG (AFileNameCONFIG: str, ALogerName: str,
1681
1678
  #beginfunction
1682
1679
  global CONFIG
1683
1680
  CONFIG = {}
1684
- global LoggerTOOLS
1685
-
1686
- #print ('CONFIG:ADirectoryLOG:',ADirectoryLOG)
1687
1681
 
1688
1682
  LPath = LUFile.ExtractFileDir(__file__)
1689
1683
  LFileNameCONFIG = os.path.join (LPath, AFileNameCONFIG)
@@ -1694,7 +1688,8 @@ def CreateLoggerCONFIG (AFileNameCONFIG: str, ALogerName: str,
1694
1688
  CONFIG = json.load(FileCONFIG)
1695
1689
  #endwith
1696
1690
  except FileNotFoundError as ERROR:
1697
- print ('ERROR: Невозможно открыть файл', ERROR)
1691
+ print ('Невозможно открыть файл', ERROR)
1692
+ GLULogger.error('Невозможно открыть файл')
1698
1693
  #endtry
1699
1694
  else:
1700
1695
  CONFIG = copy.deepcopy (LOGGING_CONFIG)
@@ -1705,21 +1700,21 @@ def CreateLoggerCONFIG (AFileNameCONFIG: str, ALogerName: str,
1705
1700
 
1706
1701
  if AFileNameLOG == '':
1707
1702
  LOptionValue_01 = CONFIG['handlers']['FILE_01']['filename']
1708
- # print ('LOptionValue_01:',LOptionValue_01)
1703
+ print ('LOptionValue_01:',LOptionValue_01)
1709
1704
  LFileNameLOG = LUFile.ExtractFileName (LOptionValue_01)
1710
1705
  else:
1711
1706
  LFileNameLOG = LUFile.ExtractFileName (AFileNameLOG)
1712
1707
  #endif
1713
- # print('LFileNameLOG:',LFileNameLOG)
1708
+ print('LFileNameLOG:',LFileNameLOG)
1714
1709
 
1715
1710
  if AFileNameLOGjson == '':
1716
1711
  LOptionValue_02 = CONFIG['handlers']['FILE_02']['filename']
1717
- # print ('LOptionValue_02:',LOptionValue_02)
1712
+ print ('LOptionValue_02:',LOptionValue_02)
1718
1713
  LFileNameLOGjson = LUFile.ExtractFileName (LOptionValue_02)
1719
1714
  else:
1720
1715
  LFileNameLOGjson = LUFile.ExtractFileName (AFileNameLOGjson)
1721
1716
  #endif
1722
- # print('LFileNameLOGjson:',LFileNameLOGjson)
1717
+ print('LFileNameLOGjson:',LFileNameLOGjson)
1723
1718
 
1724
1719
  if ADirectoryLOG == '':
1725
1720
  # log будет создан в текущем каталоге (по умолчанию)
@@ -1735,18 +1730,16 @@ def CreateLoggerCONFIG (AFileNameCONFIG: str, ALogerName: str,
1735
1730
 
1736
1731
  # установить имена log файлов в CONFIG
1737
1732
  LOptionValue_01 = os.path.join (LDirectoryLOG, LFileNameLOG)
1738
- # print('LOptionValue_01:', LOptionValue_01)
1733
+ print('LOptionValue_01:', LOptionValue_01)
1739
1734
  CONFIG ['handlers'] ['FILE_01'] ['filename'] = LOptionValue_01
1740
1735
 
1741
1736
  LOptionValue_02 = os.path.join (LDirectoryLOG, LFileNameLOGjson)
1742
- # print('LOptionValue_02:', LOptionValue_02)
1737
+ print('LOptionValue_02:', LOptionValue_02)
1743
1738
  CONFIG ['handlers'] ['FILE_02'] ['filename'] = LOptionValue_02
1744
1739
 
1745
1740
  if len(CONFIG) > 0:
1746
1741
  #-------------------------------------------------------------------
1747
- # LFileNameCONFIG = os.path.join (LUos.GetCurrentDir (), CDefaultFileLogCONFIG)
1748
- LFileNameCONFIG = os.path.join (LUFile.GetTempDir(), CDefaultFileLogCONFIG)
1749
-
1742
+ LFileNameCONFIG = os.path.join (LUos.GetCurrentDir (), CDefaultFileLogCONFIG)
1750
1743
  LUDict.SaveDictSTR (CONFIG, LFileNameCONFIG)
1751
1744
  #-------------------------------------------------------------------
1752
1745
  # читаем конфигурацию из словаря
@@ -1778,7 +1771,8 @@ def CreateLoggerYAML (AFileNameYAML: str, ALogerName: str, ADirectoryLOG: str, A
1778
1771
  CONFIG_YAML = yaml.load(FileCONFIG_YAML, Loader=yaml.FullLoader)
1779
1772
  #endwith
1780
1773
  except FileNotFoundError as ERROR:
1781
- print ('ERROR: Невозможно открыть файл', ERROR)
1774
+ print ('Невозможно открыть файл', ERROR)
1775
+ GLULogger.error ('Невозможно открыть файл')
1782
1776
  #endtry
1783
1777
  else:
1784
1778
  CONFIG_YAML = copy.deepcopy (LOGGING_CONFIG)
@@ -1789,21 +1783,21 @@ def CreateLoggerYAML (AFileNameYAML: str, ALogerName: str, ADirectoryLOG: str, A
1789
1783
 
1790
1784
  if AFileNameLOG == '':
1791
1785
  LOptionValue_01 = CONFIG_YAML ['handlers'] ['FILE_01'] ['filename']
1792
- # print ('LOptionValue_01:', LOptionValue_01)
1786
+ print ('LOptionValue_01:', LOptionValue_01)
1793
1787
  LFileNameLOG = LUFile.ExtractFileName (LOptionValue_01)
1794
1788
  else:
1795
1789
  LFileNameLOG = LUFile.ExtractFileName (AFileNameLOG)
1796
1790
  #endif
1797
- # print ('LFileNameLOG:', LFileNameLOG)
1791
+ print ('LFileNameLOG:', LFileNameLOG)
1798
1792
 
1799
1793
  if AFileNameLOGjson == '':
1800
1794
  LOptionValue_02 = CONFIG_YAML ['handlers'] ['FILE_02'] ['filename']
1801
- # print ('LOptionValue_02:', LOptionValue_02)
1795
+ print ('LOptionValue_02:', LOptionValue_02)
1802
1796
  LFileNameLOGjson = LUFile.ExtractFileName (LOptionValue_02)
1803
1797
  else:
1804
1798
  LFileNameLOGjson = LUFile.ExtractFileName (AFileNameLOGjson)
1805
1799
  #endif
1806
- # print ('LFileNameLOGjson:', LFileNameLOGjson)
1800
+ print ('LFileNameLOGjson:', LFileNameLOGjson)
1807
1801
 
1808
1802
  if ADirectoryLOG == '':
1809
1803
  # log будет создан в текущем каталоге (по умолчанию)
@@ -1819,10 +1813,11 @@ def CreateLoggerYAML (AFileNameYAML: str, ALogerName: str, ADirectoryLOG: str, A
1819
1813
 
1820
1814
  # установить имена log файлов в CONFIG
1821
1815
  LOptionValue_01 = os.path.join (LDirectoryLOG, LFileNameLOG)
1822
- # print('LOptionValue_01:', LOptionValue_01)
1816
+ print('LOptionValue_01:', LOptionValue_01)
1823
1817
  CONFIG_YAML ['handlers'] ['FILE_01'] ['filename'] = LOptionValue_01
1818
+
1824
1819
  LOptionValue_02 = os.path.join (LDirectoryLOG, LFileNameLOGjson)
1825
- # print('LOptionValue_02:', LOptionValue_02)
1820
+ print('LOptionValue_02:', LOptionValue_02)
1826
1821
  CONFIG_YAML ['handlers'] ['FILE_02'] ['filename'] = LOptionValue_02
1827
1822
 
1828
1823
  if len (CONFIG_YAML) > 0:
@@ -1853,69 +1848,53 @@ def CreateLoggerFILEINI (AFileNameINI: str, ALogerName: str,
1853
1848
  LDirectoryLOG = ADirectoryLOG
1854
1849
 
1855
1850
  # читаем конфигурацию из файла INI
1856
- LFileNameINI = LUFile.ExpandFileName (AFileNameINI)
1857
-
1858
- if LUFile.FileExists (LFileNameINI):
1851
+ LFileNameINI = lyr.LUFile.ExpandFileName (AFileNameINI)
1852
+ if lyr.LUFile.FileExists (LFileNameINI):
1859
1853
  # существует файл, который можно редактировать
1860
1854
  SetEditINI = True
1861
1855
  LPathINI = LUFile.ExtractFileDir (LFileNameINI)
1862
1856
  LFileNameINI = os.path.join (LPathINI, LUFile.ExtractFileName (AFileNameINI))
1863
1857
  else:
1864
- SetEditINI = False
1865
- if not ALogerName == 'console':
1866
- LPathINI = LUos.GetCurrentDir ()
1867
- LFileNameINI = os.path.join (LPathINI, LUFile.ExtractFileName (AFileNameINI))
1868
- if LUFile.FileExists (LFileNameINI):
1869
- # существует файл в текущем каталоге, который можно редактировать
1870
- SetEditINI = True
1871
- else:
1872
- # берем имя файла из проекта, если оно есть
1873
- SetEditINI = True
1874
- LPathINI = LUFile.ExtractFileDir (__file__)
1875
- LFileNameINIorig = os.path.join (LPathINI, CDefaultFileLogINI)
1876
- # Копирование файла
1877
- shutil.copy (LFileNameINIorig, LFileNameINI)
1878
- #endif
1858
+ LPathINI = lyr.LUos.GetCurrentDir ()
1859
+ LFileNameINI = os.path.join (LPathINI, lyr.LUFile.ExtractFileName (AFileNameINI))
1860
+ # print ('LFileNameINI: ', LFileNameINI)
1861
+ if lyr.LUFile.FileExists (LFileNameINI):
1862
+ # существует файл в текущем каталоге, который можно редактировать
1863
+ SetEditINI = True
1879
1864
  else:
1880
- LPathINI = LUFile.ExtractFileDir (__file__)
1881
- LFileNameINI = os.path.join (LPathINI, LUFile.ExtractFileName (AFileNameINI))
1865
+ # берем имя файла из проекта, если оно есть
1866
+ LPathINI = lyr.LUFile.ExtractFileDir (__file__)
1867
+ LFileNameINI = os.path.join (LPathINI, lyr.LUFile.ExtractFileName (AFileNameINI))
1868
+ SetEditINI = False
1882
1869
  #endif
1883
1870
  #endif
1884
-
1885
- # print ('LFileNameINI:', LFileNameINI)
1871
+ # print ('LPathINI:',LPathINI)
1872
+ # print ('LFileNameINI:',LFileNameINI)
1886
1873
 
1887
1874
  if not SetEditINI:
1888
- # print ('ALogerName:',ALogerName)
1889
1875
  pass
1890
1876
  else:
1891
- # print ('AFileNameLOG:', AFileNameLOG)
1892
1877
  LINIFile = LUParserINI.TINIFile ()
1893
1878
  LINIFile.FileNameINI = LFileNameINI
1894
1879
  LOptionName = 'args'
1895
1880
  if AFileNameLOG == '':
1896
1881
  LSectionName_01 = 'handler_FILE_01'
1897
- LOptionValue_01 = LINIFile.GetOption(LSectionName_01, LOptionName, '')
1898
- # print ('LOptionValue_01:',LOptionValue_01)
1899
- LFileNameLOG = LOptionValue_01.split("'")[1]
1900
- # print('LFileNameLOG:',LFileNameLOG)
1901
- LFileNameLOG = LUFile.ExtractFileName (LFileNameLOG)
1882
+ LOptionValue_01 = LINIFile.GetOption(LSectionName_01, LOptionName)
1883
+ print ('LOptionValue_01:',LOptionValue_01)
1884
+ LFileNameLOG = LUFile.ExtractFileName (LOptionValue_01.split([',', '('])[0])
1902
1885
  else:
1903
1886
  LFileNameLOG = LUFile.ExtractFileName (AFileNameLOG)
1904
1887
  #endif
1905
1888
  # print('LFileNameLOG:',LFileNameLOG)
1906
-
1907
1889
  if AFileNameLOGjson == '':
1908
1890
  LSectionName_02 = 'handler_FILE_02'
1909
- LOptionValue_02 = LINIFile.GetOption(LSectionName_02, LOptionName, '')
1910
- # print ('LOptionValue_02:',LOptionValue_02)
1911
- LFileNameLOGjson = LOptionValue_02.split("'")[1]
1912
- # print('LFileNameLOGjson:',LFileNameLOGjson)
1913
- LFileNameLOGjson = LUFile.ExtractFileName (LFileNameLOGjson)
1891
+ LOptionValue_02 = LINIFile.GetOption(LSectionName_02, LOptionName)
1892
+ print ('LOptionValue_02:',LOptionValue_02)
1893
+ LFileNameLOGjson = LUFile.ExtractFileName (LOptionValue_02.split([',', '('])[0])
1914
1894
  else:
1915
1895
  LFileNameLOGjson = LUFile.ExtractFileName (AFileNameLOGjson)
1916
1896
  #endif
1917
- print('AFileNameLOGjson:',AFileNameLOGjson)
1918
- print('LFileNameLOGjson:',LFileNameLOGjson)
1897
+ # print('LFileNameLOGjson:',LFileNameLOGjson)
1919
1898
 
1920
1899
  # установить имена log файлов в ini
1921
1900
  LOptionValue_01 = "('" + os.path.join (LDirectoryLOG, LFileNameLOG) + "',)"
@@ -1923,49 +1902,43 @@ def CreateLoggerFILEINI (AFileNameINI: str, ALogerName: str,
1923
1902
  LOptionValue_01 = LOptionValue_01.replace ('\\', "\\\\")
1924
1903
  #endif
1925
1904
  if LUos.GOSInfo.system == 'Linux':
1926
- raise 'ERROR: Linux не поддерживается'
1905
+ raise 'Linux не поддерживается'
1927
1906
  #endif
1928
- # print('LOptionValue_01:',LOptionValue_01)
1907
+ # print(LOptionValue_01)
1908
+
1929
1909
  LINIFile.SetOption ('handler_FILE_01', LOptionName, LOptionValue_01)
1930
1910
  LOptionValue_02 = "('" + os.path.join (LDirectoryLOG, LFileNameLOGjson) + "',)"
1911
+
1931
1912
  if LUos.GOSInfo.system == 'Windows':
1932
1913
  LOptionValue_02 = LOptionValue_02.replace ("\\", "\\\\")
1933
1914
  #endif
1934
1915
  if LUos.GOSInfo.system == 'Linux':
1935
- raise 'ERROR: Linux не поддерживается'
1916
+ raise 'Linux не поддерживается'
1936
1917
  #endif
1937
- # print('LOptionValue_02:',LOptionValue_02)
1918
+ # print(LOptionValue_02)
1938
1919
 
1939
1920
  LINIFile.SetOption ('handler_FILE_02', LOptionName, LOptionValue_02)
1940
1921
  LINIFile.UpdateFileINI ()
1941
1922
  #endif
1942
1923
 
1943
- # print ('INI:ADirectoryLOG:',ADirectoryLOG)
1944
1924
  if ADirectoryLOG == '':
1945
1925
  # log будет создан в текущем каталоге (по умолчанию)
1946
1926
  LDirectoryLOG = LUos.GetCurrentDir ()
1947
1927
  else:
1948
1928
  # log будет создан в ADirectoryLOG
1949
- LDirectoryLOG = LUFile.ExpandFileName (ADirectoryLOG)
1929
+ LDirectoryLOG = lyr.LUFile.ExpandFileName (ADirectoryLOG)
1950
1930
  #endif
1951
- # print('...LDirectoryLOG:',LDirectoryLOG)
1952
-
1953
- if not LUFile.DirectoryExists (LDirectoryLOG):
1954
- LUFile.ForceDirectories(LDirectoryLOG)
1931
+ # print('LDirectoryLOG:',LDirectoryLOG)
1932
+ if not lyr.LUFile.DirectoryExists (LDirectoryLOG):
1933
+ lyr.LUFile.ForceDirectories(LDirectoryLOG)
1955
1934
  #endif
1956
1935
 
1957
- # os.chdir (LDirectoryLOG)
1958
-
1959
- # print(LFileNameINI)
1960
-
1961
- logging.config.fileConfig (LFileNameINI, disable_existing_loggers=True,
1962
- encoding=LUFile.cDefaultEncoding)
1936
+ print(LFileNameINI)
1937
+ logging.config.fileConfig (LFileNameINI, disable_existing_loggers=True, encoding=lyr.LUFile.cDefaultEncoding)
1963
1938
  # logging.config.fileConfig (LFileNameINI, disable_existing_loggers=True, encoding='cp1251')
1964
1939
 
1965
1940
  # создаем регистратор
1966
1941
  LResult = logging.getLogger (ALogerName)
1967
- # print(f'{LResult.name=}')
1968
- # print(f'{LResult.handlers=}')
1969
1942
  # установить форматер
1970
1943
  SetFormatterForLogger (LResult)
1971
1944
 
@@ -2018,72 +1991,46 @@ def CreateTFileMemoLog () -> TFileMemoLog:
2018
1991
  #-------------------------------------------------
2019
1992
  # Инициализация системы logging
2020
1993
  #-------------------------------------------------
2021
- STATLogging = True
2022
-
2023
- GLoggerFILEINI = logging.Logger
2024
- GLoggerCONFIG = logging.Logger
2025
- LoggerTOOLS = logging.Logger
2026
- LoggerAPPS = logging.Logger
2027
- LoggerTLogger = TLogger
2028
- FileMemoLog = TFileMemoLog
2029
-
2030
- def STARTLogging (T: TTypeSETUPLOG, ALogerName, ADirectoryLOG: str, AFileNameLOG: str, AFileNameLOGjson: str) -> None:
1994
+ GLoggerFILEINI = None
1995
+ GLoggerCONFIG = None
1996
+ LoggerTOOLS = None
1997
+ LoggerAPPS = None
1998
+ LoggerTLogger = None
1999
+ FileMemoLog = None
2000
+
2001
+ def STARTLogging (T: TTypeSETUPLOG, ADirectoryLOG: str, AFileNameLOG: str, AFileNameLOGjson: str) -> None:
2031
2002
  """STARTLogging"""
2032
2003
  #beginfunction
2033
- global GLoggerFILEINI
2034
- global GLoggerCONFIG
2035
- global LoggerTOOLS
2036
- global LoggerAPPS
2037
- global LoggerTLogger
2038
- global FileMemoLog
2039
2004
  global STATLogging
2040
-
2041
2005
  STATLogging = False
2042
-
2043
2006
  # print (sys._getframe (0).f_code.co_name, '...')
2007
+
2044
2008
  # print (inspect.currentframe().f_code.co_name, '...')
2045
2009
  # print (inspect.stack () [0] [3], '...')
2046
2010
  # print (traceback.extract_stack () [-1].name, '...')
2047
2011
 
2048
- LLogerNames = ['root','log01','log01', 'console']
2012
+ global GLoggerFILEINI
2013
+ global GLoggerCONFIG
2014
+ global LoggerTOOLS
2015
+ global LoggerAPPS
2016
+ global LoggerTLogger
2017
+ global FileMemoLog
2049
2018
 
2050
2019
  AddLevelName ()
2051
2020
 
2052
- LT = T
2053
- if LUos.GOSInfo.system == 'Windows':
2054
- LT = T
2055
- #endif
2056
- if LUos.GOSInfo.system == 'Linux':
2057
- LT = TTypeSETUPLOG.tslCONFIG
2058
- #endif
2059
-
2060
- if ALogerName in LLogerNames:
2061
- match LT:
2062
- case TTypeSETUPLOG.tslCONFIG:
2063
- GLoggerCONFIG = CreateLoggerCONFIG (CDefaultFileLogCONFIG, ALogerName,
2064
- ADirectoryLOG, AFileNameLOG,
2065
- AFileNameLOGjson)
2066
- case TTypeSETUPLOG.tslYAML:
2067
- GLoggerYAML = CreateLoggerYAML (CDefaultFileLogYAML, ALogerName,
2068
- ADirectoryLOG, AFileNameLOG,
2021
+ match T:
2022
+ case TTypeSETUPLOG.tslCONFIG:
2023
+ GLoggerCONFIG = CreateLoggerCONFIG (CDefaultFileLogCONFIG, 'root', ADirectoryLOG, AFileNameLOG,
2069
2024
  AFileNameLOGjson)
2070
- case TTypeSETUPLOG.tslINI:
2071
- if ALogerName == 'console' or LUConst.GAPPName is None:
2072
- # 'logging_CONSOLE.INI'
2073
- LFileLogINI = CDefaultFileLogINI
2074
- LFileLogINI = CDefaultFileLogINI_CONSOLE
2075
- else:
2076
- LFileLogINI = LUConst.GAPPName+'.ini'
2077
- #endif
2078
- GLoggerFILEINI = CreateLoggerFILEINI (LFileLogINI, ALogerName,
2079
- ADirectoryLOG, AFileNameLOG,
2080
- AFileNameLOGjson)
2081
- case _:
2082
- pass
2083
- #endmatch
2084
- else:
2085
- exit()
2086
- #endif
2025
+ case TTypeSETUPLOG.tslYAML:
2026
+ GLoggerYAML = CreateLoggerYAML (CDefaultFileLogYAML, 'root', ADirectoryLOG, AFileNameLOG,
2027
+ AFileNameLOGjson)
2028
+ case TTypeSETUPLOG.tslINI:
2029
+ GLoggerFILEINI = CreateLoggerFILEINI (CDefaultFileLogINI, 'root', ADirectoryLOG, AFileNameLOG,
2030
+ AFileNameLOGjson)
2031
+ case _:
2032
+ ...
2033
+ #endmatch
2087
2034
 
2088
2035
  #-------------------------------------------------
2089
2036
  # GLoggerBASIC = CreateLoggerBASIC (logging.DEBUG, 'LOG\\' + CDefaultFileLogFILEBASIC, 'root')
@@ -2095,8 +2042,7 @@ def STARTLogging (T: TTypeSETUPLOG, ALogerName, ADirectoryLOG: str, AFileNameLOG
2095
2042
  #-------------------------------------------------
2096
2043
  CLoggerTOOLS = 'TOOLS__'
2097
2044
  LoggerTOOLS = logging.getLogger (CLoggerTOOLS)
2098
- # LoggerTOOLS.disabled = False
2099
- # LoggerTOOLS.info ('info')
2045
+ LoggerTOOLS.disabled = False
2100
2046
  # print('LoggerTOOLS' in vars () or 'LoggerTOOLS' in globals ())
2101
2047
  # print('LoggerTOOLS' in vars ())
2102
2048
  # print('LoggerTOOLS' in globals ())
@@ -2108,7 +2054,7 @@ def STARTLogging (T: TTypeSETUPLOG, ALogerName, ADirectoryLOG: str, AFileNameLOG
2108
2054
  #-------------------------------------------------
2109
2055
  # LoggerAPPS
2110
2056
  #-------------------------------------------------
2111
- CLoggerAPPS = 'APPS__'
2057
+ CLoggerAPPS = 'APPS___'
2112
2058
  LoggerAPPS = logging.getLogger(CLoggerAPPS)
2113
2059
 
2114
2060
  #-------------------------------------------------
@@ -2129,25 +2075,21 @@ def STARTLogging (T: TTypeSETUPLOG, ALogerName, ADirectoryLOG: str, AFileNameLOG
2129
2075
  logger.setLevel(logging.INFO)
2130
2076
  logger = logging.getLogger('chardet.universaldetector')
2131
2077
  logger.setLevel(logging.INFO)
2132
-
2133
2078
  #-------------------------------------------------
2134
2079
  # Отключить журнал 'pytube.extract'
2135
2080
  #-------------------------------------------------
2136
2081
  logger = logging.getLogger('pytube.extract')
2137
2082
  logger.setLevel(logging.INFO)
2138
-
2139
2083
  #-------------------------------------------------
2140
2084
  # Отключить журнал 'pytube.streams'
2141
2085
  #-------------------------------------------------
2142
2086
  logger = logging.getLogger('pytube.streams')
2143
2087
  logger.setLevel(logging.INFO)
2144
-
2145
2088
  #-------------------------------------------------
2146
2089
  # Отключить журнал 'pytube.cipher'
2147
2090
  #-------------------------------------------------
2148
2091
  logger = logging.getLogger('pytube.cipher')
2149
2092
  logger.setLevel(logging.INFO)
2150
-
2151
2093
  #-------------------------------------------------
2152
2094
  # Отключить журнал 'pytube.helpers'
2153
2095
  #-------------------------------------------------
@@ -2164,21 +2106,20 @@ def STOPLogging () -> None:
2164
2106
  """STOPLogging"""
2165
2107
  #beginfunction
2166
2108
  global STATLogging
2167
- # global LoggerTOOLS
2109
+ global LoggerTOOLS
2168
2110
  STATLogging = False
2169
2111
  # LoggerTOOLS.disabled = True# Выключить систему logging для логгирования
2170
2112
  #endfunction
2171
2113
 
2172
2114
  #-------------------------------------------------
2173
- # LoggerAdd
2115
+ # LoggerTOOLS_AddLevel
2174
2116
  #-------------------------------------------------
2175
- def LoggerAdd (ALogger, ALevel, Astr):
2117
+ def LoggerTOOLS_AddLevel (ALevel, Astr):
2176
2118
  #beginfunction
2177
2119
  if STATLogging:
2178
2120
  try:
2179
- ALogger.log(ALevel, Astr)
2121
+ LoggerTOOLS.log(ALevel, Astr)
2180
2122
  except:
2181
- print("ERROR:")
2182
2123
  ...
2183
2124
  #endtry
2184
2125
  else:
@@ -2186,121 +2127,105 @@ def LoggerAdd (ALogger, ALevel, Astr):
2186
2127
  #endif
2187
2128
  #endfunction
2188
2129
 
2189
- # #-------------------------------------------------
2190
- # # LoggerTOOLS_AddLevel
2191
- # #-------------------------------------------------
2192
- # def LoggerTOOLS_AddLevel (ALevel, Astr):
2193
- # #beginfunction
2194
- # if STATLogging:
2195
- # try:
2196
- # LoggerTOOLS.log(ALevel, Astr)
2197
- # except:
2198
- # ...
2199
- # #endtry
2200
- # else:
2201
- # print("INFO: система не включена для записи логов")
2202
- # #endif
2203
- # #endfunction
2204
- #
2205
- # #-------------------------------------------------
2206
- # # LoggerTOOLS_AddDebug
2207
- # #-------------------------------------------------
2208
- # def LoggerTOOLS_AddDebug (Astr):
2209
- # #beginfunction
2210
- # if STATLogging:
2211
- # try:
2212
- # LoggerTOOLS.debug(Astr)
2213
- # except:
2214
- # ...
2215
- # #endtry
2216
- # else:
2217
- # print("INFO: система не включена для записи логов")
2218
- # #endif
2219
- # #endfunction
2220
- #
2221
- # #-------------------------------------------------
2222
- # # LoggerTOOLS_AddError
2223
- # #-------------------------------------------------
2224
- # def LoggerTOOLS_AddError (Astr):
2225
- # #beginfunction
2226
- # if STATLogging:
2227
- # try:
2228
- # LoggerTOOLS.error(Astr)
2229
- # except:
2230
- # ...
2231
- # #endtry
2232
- # else:
2233
- # print("INFO: система не включена для записи логов")
2234
- # #endif
2235
- # #endfunction
2236
- #
2237
- # #-------------------------------------------------
2238
- # # LoggerAPPS_AddLevel
2239
- # #-------------------------------------------------
2240
- # #LULog.LoggerAPPS.log
2241
- # def LoggerAPPS_AddLevel (ALevel, Astr):
2242
- # #beginfunction
2243
- # if STATLogging:
2244
- # try:
2245
- # LoggerAPPS.log(ALevel, Astr)
2246
- # except:
2247
- # ...
2248
- # #endtry
2249
- # else:
2250
- # print("INFO: система не включена для записи логов")
2251
- # #endif
2252
- # #endfunction
2253
- #
2254
- # #-------------------------------------------------
2255
- # # LoggerAPPS_AddInfo
2256
- # #-------------------------------------------------
2257
- # #LULog.LoggerAPPS.info
2258
- # def LoggerAPPS_AddInfo (Astr):
2259
- # #beginfunction
2260
- # if STATLogging:
2261
- # try:
2262
- # LoggerAPPS.info(Astr)
2263
- # except:
2264
- # ...
2265
- # #endtry
2266
- # else:
2267
- # print("INFO: система не включена для записи логов")
2268
- # #endif
2269
- # #endfunction
2270
- #
2271
- # #-------------------------------------------------
2272
- # # LoggerAPPS_AddError
2273
- # #-------------------------------------------------
2274
- # #LULog.LoggerAPPS.error
2275
- # def LoggerAPPS_AddError (Astr):
2276
- # #beginfunction
2277
- # if STATLogging:
2278
- # try:
2279
- # LoggerAPPS.error(Astr)
2280
- # except:
2281
- # ...
2282
- # #endtry
2283
- # else:
2284
- # print("INFO: система не включена для записи логов")
2285
- # #endif
2286
- # #endfunction
2287
- #
2288
- # #-------------------------------------------------
2289
- # # LoggerAPPS_AddDebug
2290
- # #-------------------------------------------------
2291
- # #LULog.LoggerAPPS.debug
2292
- # def LoggerAPPS_AddDebug (Astr):
2293
- # #beginfunction
2294
- # if STATLogging:
2295
- # try:
2296
- # LoggerAPPS.debug(Astr)
2297
- # except:
2298
- # ...
2299
- # #endtry
2300
- # else:
2301
- # print("INFO: система не включена для записи логов")
2302
- # #endif
2303
- # #endfunction
2130
+ #-------------------------------------------------
2131
+ # LoggerTOOLS_AddDebug
2132
+ #-------------------------------------------------
2133
+ def LoggerTOOLS_AddDebug (Astr):
2134
+ #beginfunction
2135
+ if STATLogging:
2136
+ try:
2137
+ LoggerTOOLS.debug(Astr)
2138
+ except:
2139
+ ...
2140
+ #endtry
2141
+ else:
2142
+ print("INFO: система не включена для записи логов")
2143
+ #endif
2144
+ #endfunction
2145
+
2146
+ #-------------------------------------------------
2147
+ # LoggerTOOLS_AddError
2148
+ #-------------------------------------------------
2149
+ def LoggerTOOLS_AddError (Astr):
2150
+ #beginfunction
2151
+ if STATLogging:
2152
+ try:
2153
+ LoggerTOOLS.error(Astr)
2154
+ except:
2155
+ ...
2156
+ #endtry
2157
+ else:
2158
+ print("INFO: система не включена для записи логов")
2159
+ #endif
2160
+ #endfunction
2161
+
2162
+ #-------------------------------------------------
2163
+ # LoggerAPPS_AddLevel
2164
+ #-------------------------------------------------
2165
+ #LULog.LoggerAPPS.log
2166
+ def LoggerAPPS_AddLevel (ALevel, Astr):
2167
+ #beginfunction
2168
+ if STATLogging:
2169
+ try:
2170
+ LoggerAPPS.log(ALevel, Astr)
2171
+ except:
2172
+ ...
2173
+ #endtry
2174
+ else:
2175
+ print("INFO: система не включена для записи логов")
2176
+ #endif
2177
+ #endfunction
2178
+
2179
+ #-------------------------------------------------
2180
+ # LoggerAPPS_AddInfo
2181
+ #-------------------------------------------------
2182
+ #LULog.LoggerAPPS.info
2183
+ def LoggerAPPS_AddInfo (Astr):
2184
+ #beginfunction
2185
+ if STATLogging:
2186
+ try:
2187
+ LoggerAPPS.info(Astr)
2188
+ except:
2189
+ ...
2190
+ #endtry
2191
+ else:
2192
+ print("INFO: система не включена для записи логов")
2193
+ #endif
2194
+ #endfunction
2195
+
2196
+ #-------------------------------------------------
2197
+ # LoggerAPPS_AddError
2198
+ #-------------------------------------------------
2199
+ #LULog.LoggerAPPS.error
2200
+ def LoggerAPPS_AddError (Astr):
2201
+ #beginfunction
2202
+ if STATLogging:
2203
+ try:
2204
+ LoggerAPPS.error(Astr)
2205
+ except:
2206
+ ...
2207
+ #endtry
2208
+ else:
2209
+ print("INFO: система не включена для записи логов")
2210
+ #endif
2211
+ #endfunction
2212
+
2213
+ #-------------------------------------------------
2214
+ # LoggerAPPS_AddDebug
2215
+ #-------------------------------------------------
2216
+ #LULog.LoggerAPPS.debug
2217
+ def LoggerAPPS_AddDebug (Astr):
2218
+ #beginfunction
2219
+ if STATLogging:
2220
+ try:
2221
+ LoggerAPPS.debug(Astr)
2222
+ except:
2223
+ ...
2224
+ #endtry
2225
+ else:
2226
+ print("INFO: система не включена для записи логов")
2227
+ #endif
2228
+ #endfunction
2304
2229
 
2305
2230
  #-------------------------------------------------
2306
2231
  # main