Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
csst_common
Commits
6774a8f4
Commit
6774a8f4
authored
Dec 24, 2025
by
BO ZHANG
🏀
Browse files
remove module logger
parent
634b398a
Pipeline
#11617
passed with stage
in 0 seconds
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
csst_common/pipeline.py
View file @
6774a8f4
...
...
@@ -114,14 +114,10 @@ class Pipeline:
self
.
kwargs
:
dict
=
kwargs
# set logger
self
.
pipeline_
logger
=
get_logger
(
self
.
logger
=
get_logger
(
name
=
"pipeline logger"
,
filename
=
os
.
path
.
join
(
self
.
dir_output
,
pipeline_log
),
)
self
.
module_logger
=
get_logger
(
name
=
"module logger"
,
filename
=
os
.
path
.
join
(
self
.
dir_output
,
module_log
),
)
# change working directory
print
(
f
"Change directory to
{
self
.
dir_output
}
"
)
...
...
@@ -167,7 +163,7 @@ class Pipeline:
"""Summarize this run."""
t_stop
:
Time
=
Time
.
now
()
t_cost
:
float
=
(
t_stop
-
self
.
t_start
).
value
*
86400.0
self
.
pipeline_
logger
.
info
(
f
"Total cost:
{
t_cost
:
.
1
f
}
sec"
)
self
.
logger
.
info
(
f
"Total cost:
{
t_cost
:
.
1
f
}
sec"
)
def
clean_output
(
self
):
"""Clean output directory."""
...
...
@@ -223,12 +219,15 @@ class Pipeline:
for
file_path
in
file_paths
:
pass
def
download_oss_file
(
self
,
oss_file_path
:
str
)
->
None
:
"""Download an OSS file from OSS to local path."""
# self.dfs.download_file(oss_file_path, local_path)
pass
def
call
(
self
,
func
:
Callable
,
*
args
:
Any
,
**
kwargs
:
Any
):
self
.
pipeline_logger
.
info
(
f
"====================================================="
)
self
.
logger
.
info
(
f
"====================================================="
)
t_start
:
Time
=
Time
.
now
()
self
.
pipeline_
logger
.
info
(
f
"Starting Module: **
{
func
.
__name__
}
**"
)
self
.
logger
.
info
(
f
"Starting Module: **
{
func
.
__name__
}
**"
)
# logger.info(f"Additional arguments: {args} {kwargs}")
try
:
# if the module works well
...
...
@@ -241,7 +240,7 @@ class Pipeline:
except
Exception
as
e
:
# if the module raises error
exc_info
=
traceback
.
format_exc
()
# traceback info
self
.
pipeline_
logger
.
error
(
f
"Error occurs!
\n
{
exc_info
}
"
)
self
.
logger
.
error
(
f
"Error occurs!
\n
{
exc_info
}
"
)
# define results
status
=
CsstStatus
.
ERROR
# default status if exceptions occur
files
=
None
...
...
@@ -251,16 +250,16 @@ class Pipeline:
t_cost
:
float
=
(
t_stop
-
t_start
).
value
*
86400
if
isinstance
(
status
,
CsstStatus
):
# status is
self
.
pipeline_
logger
.
info
(
self
.
logger
.
info
(
f
"Module finished: status=
{
status
}
| cost=
{
t_cost
:
.
1
f
}
sec"
)
else
:
# invalid status
self
.
pipeline_
logger
.
error
(
self
.
logger
.
error
(
f
"Invalid status:
{
status
}
is not a CsstResult object!"
)
# record exception traceback info
self
.
pipeline_
logger
.
info
(
self
.
logger
.
info
(
f
"ModuleResult:
\n
"
f
" - name:
{
func
.
__name__
}
\n
"
f
" - status:
{
status
}
\n
"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment