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