pilot.linkstec 0.0.14__tar.gz → 0.0.16__tar.gz
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 pilot.linkstec might be problematic. Click here for more details.
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/PKG-INFO +1 -1
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/pyproject.toml +1 -1
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/job/impl/base_job.py +20 -2
- pilot_linkstec-0.0.16/src/pilot/logging/logger.py +57 -0
- pilot_linkstec-0.0.16/src/pilot/util/__init__.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot.linkstec.egg-info/PKG-INFO +1 -1
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot.linkstec.egg-info/SOURCES.txt +2 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/LICENSE +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/README.md +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/setup.cfg +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/__init__.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/config/__init__.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/config/config_reader.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/control/__init__.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/control/control_interface.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/control/impl/__init__.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/control/impl/base_controller.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/conver/__init__.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/conver/converfileEncodding.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/conver/nkf_converter.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/generater/__init__.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/generater/vertexai.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/job/__init__.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/job/impl/__init__.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/job/job_interface.py +0 -0
- {pilot_linkstec-0.0.14/src/pilot/splitters → pilot_linkstec-0.0.16/src/pilot/logging}/__init__.py +0 -0
- {pilot_linkstec-0.0.14/src/pilot/unit → pilot_linkstec-0.0.16/src/pilot/splitters}/__init__.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/splitters/cobolsplitter.py +0 -0
- {pilot_linkstec-0.0.14/src/pilot/unit/impl → pilot_linkstec-0.0.16/src/pilot/unit}/__init__.py +0 -0
- {pilot_linkstec-0.0.14/src/pilot/util → pilot_linkstec-0.0.16/src/pilot/unit/impl}/__init__.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/unit/impl/base_unit.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/unit/unit_interface.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot/util/files.py +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot.linkstec.egg-info/dependency_links.txt +0 -0
- {pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot.linkstec.egg-info/top_level.txt +0 -0
|
@@ -2,11 +2,12 @@ import os
|
|
|
2
2
|
import shutil
|
|
3
3
|
|
|
4
4
|
from pilot.job.job_interface import JobInterface
|
|
5
|
-
from pilot.
|
|
5
|
+
from pilot.logging.logger import get_logger
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class BaseJob(JobInterface):
|
|
9
9
|
def __init__(self):
|
|
10
|
+
self.logger = get_logger(__name__)
|
|
10
11
|
self.config_dto = None
|
|
11
12
|
self._current_step = None
|
|
12
13
|
self._file_path = None
|
|
@@ -15,6 +16,7 @@ class BaseJob(JobInterface):
|
|
|
15
16
|
self._next_step_file_path = None
|
|
16
17
|
self._content = None
|
|
17
18
|
|
|
19
|
+
|
|
18
20
|
@property
|
|
19
21
|
def current_step(self):
|
|
20
22
|
return self._current_step
|
|
@@ -325,4 +327,20 @@ class BaseJob(JobInterface):
|
|
|
325
327
|
open(end_file, 'w', encoding='utf-8').close()
|
|
326
328
|
return end_file
|
|
327
329
|
|
|
328
|
-
return None
|
|
330
|
+
return None
|
|
331
|
+
|
|
332
|
+
def pre_run(self):
|
|
333
|
+
"""
|
|
334
|
+
ジョブ実行前の前処理を行うメソッド。
|
|
335
|
+
必要に応じてサブクラスでオーバーライドして使用する。
|
|
336
|
+
"""
|
|
337
|
+
pass
|
|
338
|
+
|
|
339
|
+
def post_run(self):
|
|
340
|
+
"""
|
|
341
|
+
ジョブ実行後の後処理を行うメソッド。
|
|
342
|
+
必要に応じてサブクラスでオーバーライドして使用する。
|
|
343
|
+
"""
|
|
344
|
+
pass
|
|
345
|
+
|
|
346
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import sys
|
|
3
|
+
import threading
|
|
4
|
+
|
|
5
|
+
# コンソールカラーのコード定義
|
|
6
|
+
RESET = "\x1b[0m"
|
|
7
|
+
COLOR_MAP = {
|
|
8
|
+
logging.DEBUG: "\x1b[37m", # 白色
|
|
9
|
+
logging.INFO: "\x1b[32m", # 緑色
|
|
10
|
+
logging.WARNING: "\x1b[33m", # 黄色
|
|
11
|
+
logging.ERROR: "\x1b[31m", # 赤色
|
|
12
|
+
logging.CRITICAL: "\x1b[41m", # 赤背景白文字
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ColoredFormatter(logging.Formatter):
|
|
17
|
+
def format(self, record):
|
|
18
|
+
color = COLOR_MAP.get(record.levelno, RESET)
|
|
19
|
+
# スレッド名を取得
|
|
20
|
+
thread_name = threading.current_thread().name
|
|
21
|
+
thread_name = thread_name.split('_', 1)[1] if '_' in thread_name else thread_name
|
|
22
|
+
# クラス名、メソッド名、行番号
|
|
23
|
+
prefix = f"{self.formatTime(record, '%Y-%m-%d %H:%M:%S')} " \
|
|
24
|
+
f"[{record.levelname}] " \
|
|
25
|
+
f"[{thread_name}] " \
|
|
26
|
+
f"[{record.module}.{record.funcName}:{record.lineno}]"
|
|
27
|
+
message = super().format(record)
|
|
28
|
+
return f"{color}{prefix} {message}{RESET}"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
_global_logger_configured = False
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def setup_global_logger(log_level: int = logging.INFO):
|
|
35
|
+
global _global_logger_configured
|
|
36
|
+
|
|
37
|
+
if not _global_logger_configured:
|
|
38
|
+
logging.basicConfig(
|
|
39
|
+
level=log_level,
|
|
40
|
+
format='%(message)s'
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
root_logger = logging.getLogger()
|
|
44
|
+
if root_logger.handlers:
|
|
45
|
+
root_logger.handlers.clear()
|
|
46
|
+
|
|
47
|
+
handler = logging.StreamHandler(sys.stdout)
|
|
48
|
+
formatter = ColoredFormatter('%(message)s')
|
|
49
|
+
handler.setFormatter(formatter)
|
|
50
|
+
root_logger.addHandler(handler)
|
|
51
|
+
root_logger.setLevel(log_level)
|
|
52
|
+
|
|
53
|
+
_global_logger_configured = True
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def get_logger(name: str) -> logging.Logger:
|
|
57
|
+
return logging.getLogger(name)
|
|
File without changes
|
|
@@ -21,6 +21,8 @@ src/pilot/job/__init__.py
|
|
|
21
21
|
src/pilot/job/job_interface.py
|
|
22
22
|
src/pilot/job/impl/__init__.py
|
|
23
23
|
src/pilot/job/impl/base_job.py
|
|
24
|
+
src/pilot/logging/__init__.py
|
|
25
|
+
src/pilot/logging/logger.py
|
|
24
26
|
src/pilot/splitters/__init__.py
|
|
25
27
|
src/pilot/splitters/cobolsplitter.py
|
|
26
28
|
src/pilot/unit/__init__.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pilot_linkstec-0.0.14/src/pilot/splitters → pilot_linkstec-0.0.16/src/pilot/logging}/__init__.py
RENAMED
|
File without changes
|
{pilot_linkstec-0.0.14/src/pilot/unit → pilot_linkstec-0.0.16/src/pilot/splitters}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{pilot_linkstec-0.0.14/src/pilot/unit/impl → pilot_linkstec-0.0.16/src/pilot/unit}/__init__.py
RENAMED
|
File without changes
|
{pilot_linkstec-0.0.14/src/pilot/util → pilot_linkstec-0.0.16/src/pilot/unit/impl}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pilot_linkstec-0.0.14 → pilot_linkstec-0.0.16}/src/pilot.linkstec.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|