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