Skip to content

Commit 2f459c0

Browse files
Dilyan MarinovDeltaMichael
authored andcommitted
vdk-core: remove redundant logs
Why As part of the run logs initiative, we should audit all log statements and error messages in vdk-core and make sure there aren't any redundancies, e.g. overly verbose messages or messages that don't add value. What Remove MSG_CONSEQUENCE_DELEGATING_TO_CALLER__LIKELY_EXECUTION_FAILURE MSG_COUNTERMEASURE_FIX_PARENT_EXCEPTION MSG_CONSEQUENCE_TERMINATING_APP where possible Re-word log statements and exception messages that are too verbose How was this tested? CI What kind of change is this? Feature/non-breaking Signed-off-by: Dilyan Marinov <mdilyan@vmware.com>
1 parent 36d3198 commit 2f459c0

File tree

13 files changed

+21
-49
lines changed

13 files changed

+21
-49
lines changed

projects/vdk-core/src/vdk/internal/builtin_plugins/config/log_config.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ def _parse_log_level_module(log_level_module):
6161
errors.VdkConfigurationError(
6262
"Invalid logging configuration passed to LOG_LEVEL_MODULE.",
6363
f"Error is: {e}. log_level_module was set to {log_level_module}.",
64-
"Logging will not be initialized and exception is raised",
6564
"Set correctly configuration to log_level_debug configuration in format 'module=level;module2=level2'",
6665
)
6766
)
@@ -148,7 +147,6 @@ def configure_loggers(
148147
errors.VdkConfigurationError(
149148
f"Provided configuration variable for {SYSLOG_SOCK_TYPE} has invalid value.",
150149
f"VDK was run with {SYSLOG_SOCK_TYPE}={syslog_sock_type}, however {syslog_sock_type} is invalid value for this variable.",
151-
errors.MSG_CONSEQUENCE_DELEGATING_TO_CALLER__LIKELY_EXECUTION_FAILURE,
152150
f"Provide a valid value for {SYSLOG_SOCK_TYPE}."
153151
f"Currently possible values are {list(SYSLOG_SOCK_TYPE_VALUES_DICT.keys())}",
154152
)

projects/vdk-core/src/vdk/internal/builtin_plugins/connection/impl/router.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ def open_connection(self, dbtype: str) -> ManagedConnectionBase:
9090
errors.VdkConfigurationError(
9191
f"Provided configuration variable for {DB_DEFAULT_TYPE} has invalid value.",
9292
f"VDK was run with {DB_DEFAULT_TYPE}={dbtype}, however {dbtype} is invalid value for this variable.",
93-
errors.MSG_CONSEQUENCE_DELEGATING_TO_CALLER__LIKELY_EXECUTION_FAILURE,
9493
f"Provide either valid value for {DB_DEFAULT_TYPE} or install database plugin that supports this type. "
9594
f"Currently possible values are {list(self._connection_builders.keys())}",
9695
)
@@ -125,7 +124,6 @@ def __create_connection(self, dbtype: str):
125124
errors.VdkConfigurationError(
126125
f"Could not create new connection of db type {dbtype}.",
127126
f"VDK was run with {DB_DEFAULT_TYPE}={dbtype}, however no valid connection was created.",
128-
errors.MSG_CONSEQUENCE_DELEGATING_TO_CALLER__LIKELY_EXECUTION_FAILURE,
129127
f"Seems to be a bug in the plugin for dbtype {dbtype}. Make sure it's correctly installed. "
130128
f"If upgraded recently consider reverting to previous version. Or use another db type. "
131129
f"Currently possible values are {list(self._connection_builders.keys())}",

projects/vdk-core/src/vdk/internal/builtin_plugins/connection/managed_connection_base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@ def execute_query(self, query: str) -> List[List[Any]]:
152152
[
153153
"Fetching all results from query FAILED.",
154154
errors.MSG_WHY_FROM_EXCEPTION(e),
155-
errors.MSG_CONSEQUENCE_DELEGATING_TO_CALLER__LIKELY_EXECUTION_FAILURE,
156-
errors.MSG_COUNTERMEASURE_FIX_PARENT_EXCEPTION,
157155
]
158156
)
159157
)

projects/vdk-core/src/vdk/internal/builtin_plugins/connection/managed_cursor.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ def execute(
116116
[
117117
"Executing query FAILED.",
118118
errors.MSG_WHY_FROM_EXCEPTION(e),
119-
errors.MSG_CONSEQUENCE_DELEGATING_TO_CALLER__LIKELY_EXECUTION_FAILURE,
120-
errors.MSG_COUNTERMEASURE_FIX_PARENT_EXCEPTION,
121119
]
122120
)
123121
)
@@ -142,8 +140,6 @@ def _decorate_operation(self, managed_operation: ManagedOperation, operation: st
142140
[
143141
"Decorating query FAILED.",
144142
errors.MSG_WHY_FROM_EXCEPTION(e),
145-
errors.MSG_CONSEQUENCE_DELEGATING_TO_CALLER__LIKELY_EXECUTION_FAILURE,
146-
errors.MSG_COUNTERMEASURE_FIX_PARENT_EXCEPTION,
147143
]
148144
)
149145
)
@@ -162,8 +158,6 @@ def _validate_operation(self, operation: str, parameters: Optional[Container]):
162158
[
163159
"Validating query FAILED.",
164160
errors.MSG_WHY_FROM_EXCEPTION(e),
165-
errors.MSG_CONSEQUENCE_DELEGATING_TO_CALLER__LIKELY_EXECUTION_FAILURE,
166-
errors.MSG_COUNTERMEASURE_FIX_PARENT_EXCEPTION,
167161
]
168162
)
169163
)

projects/vdk-core/src/vdk/internal/builtin_plugins/ingestion/ingester_router.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ def __get_ingester(self, method: str) -> IngesterBase:
8787
VdkConfigurationError(
8888
"Provided method, {method}, has invalid value.",
8989
"VDK was run with method={method}, however {method} is not part of the available ingestion mechanisms.",
90-
errors.MSG_CONSEQUENCE_DELEGATING_TO_CALLER__LIKELY_EXECUTION_FAILURE,
9190
f"Provide either valid value for method, or install ingestion plugin that supports this type. "
9291
f"Currently possible values are {list(self._ingester_builders.keys())}",
9392
)
@@ -177,7 +176,6 @@ def __initialize_ingester(self, method) -> IngesterBase:
177176
VdkConfigurationError(
178177
f"Could not create new ingester plugin of type {method}.",
179178
f"VDK was run with method={method}, however no valid ingester plugin was created.",
180-
errors.MSG_CONSEQUENCE_DELEGATING_TO_CALLER__LIKELY_EXECUTION_FAILURE,
181179
f"Seems to be a bug in the plugin for method {method}. Make sure it's correctly installed. "
182180
f"If upgraded recently consider reverting to previous version. Or use another method type.",
183181
)
@@ -223,7 +221,6 @@ def __initialize_processor(self, method) -> Optional[IIngesterPlugin]:
223221
f"VDK was run with method={method}, however "
224222
"no valid ingestion processor plugin was "
225223
"created.",
226-
errors.MSG_CONSEQUENCE_DELEGATING_TO_CALLER__LIKELY_EXECUTION_FAILURE,
227224
"Seems to be a bug in the plugin for method"
228225
f" {method}. Make sure it's correctly "
229226
f"installed. If upgraded recently, consider"
@@ -257,9 +254,6 @@ def close(self):
257254
f"On close some following ingest queues types reported errors: {list(errors_list.keys())}.",
258255
f"There were errors while closing ingestion. Exceptions were: {errors_list}.",
259256
"Some data was partially ingested or not ingested at all.",
260-
"Follow the instructions in the error messages and log warnings. "
261-
"Make sure to inspect any errors or warning logs generated"
262-
"Re-try the job if necessary",
263257
]
264258

265259
if any(

projects/vdk-core/src/vdk/internal/builtin_plugins/job_properties/properties_router.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ def __choose_from_default_type(self, properties_type: str):
9292
errors.VdkConfigurationError(
9393
f"properties default type was configured to be {properties_type} "
9494
f"no such properties api implementation has been registered",
95-
f"",
9695
f"Check if the job has not been mis-configured - for example misspelling error. "
9796
f"See config-help for help on configuration. Existing properties types are: {list(self.__properties_builders.keys())} "
9897
f"Alternatively make sure the correct plugin has been installed "

projects/vdk-core/src/vdk/internal/builtin_plugins/job_secrets/secrets_router.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ def __choose_from_default_type(self, secrets_type: str):
9090
errors.VdkConfigurationError(
9191
f"secrets default type was configured to be {secrets_type} "
9292
"no such secrets api implementation has been registered",
93-
"",
9493
"Check if the job has not been mis-configured - for example misspelling error. "
9594
f"See config-help for help on configuration. Existing secrets types are: {list(self.__secrets_builders.keys())} "
9695
"Alternatively make sure the correct plugin has been installed "

projects/vdk-core/src/vdk/internal/builtin_plugins/run/cli_run.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ def __validate_and_parse_args(arguments: str) -> Optional[Dict]:
4545
[
4646
"Failed to validate job arguments.",
4747
errors.MSG_WHY_FROM_EXCEPTION(e),
48-
errors.MSG_CONSEQUENCE_TERMINATING_APP,
49-
errors.MSG_COUNTERMEASURE_FIX_PARENT_EXCEPTION,
5048
]
5149
)
5250
)
@@ -104,14 +102,16 @@ def __warn_on_python_version_disparity(
104102
log.warning(
105103
f"""
106104
{os.linesep + (' ' * 20) + ('*' * 80)}
107-
What: Python version mismatch between local python and configure python.
108-
Why: The Python version specified in the job's config.ini file is ({configured_python_version})
105+
Python version mismatch between local python and configure python.
106+
The Python version specified in the job's config.ini file is ({configured_python_version})
109107
while the local python version used to execute the data job is ({local_py_version}).
110-
Consequences: Developing a data job using one Python version and deploying
108+
109+
Developing a data job using one Python version and deploying
111110
it with a different version can result in unexpected and
112111
difficult-to-troubleshoot errors like module incompatibilities, or
113112
unexpected behavior during execution.
114-
Countermeasures: To resolve this issue, ensure that the Python version
113+
114+
To resolve this issue, ensure that the Python version
115115
specified in the python_version property of the config.ini file matches
116116
the Python version of your execution environment by either editing the
117117
python_version property in config.ini, or switching local environment
@@ -165,10 +165,8 @@ def create_and_run_data_job(
165165
[
166166
"Failed executing job.",
167167
errors.MSG_WHY_FROM_EXCEPTION(e),
168-
errors.MSG_CONSEQUENCE_TERMINATING_APP,
169-
errors.MSG_COUNTERMEASURE_FIX_PARENT_EXCEPTION
170-
+ " Most likely a prerequisite or plugin of one of the key VDK components failed, see"
171-
+ " logs for details and ensure the prerequisite for the failed component (details in stacktrace).",
168+
" Most likely a prerequisite or plugin of one of the key VDK components failed, see"
169+
+ " logs for details and ensure the prerequisite for the failed component.",
172170
]
173171
)
174172
)

projects/vdk-core/src/vdk/internal/builtin_plugins/run/data_job.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ def run_job(context: JobContext) -> ExecutionResult:
121121
errors.UserCodeError(
122122
"Data Job execution has failed.",
123123
"Data Job has no steps.",
124-
"Data job execution will not continue.",
125124
"Please include at least 1 valid step in your Data Job. Also make sure you are passing the correct data job directory.",
126125
)
127126
)

projects/vdk-core/src/vdk/internal/builtin_plugins/run/file_based_step.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,8 @@ def run(job_input)
8888
[
8989
"Failed loading job sources of %s" % filename,
9090
errors.MSG_WHY_FROM_EXCEPTION(e),
91-
errors.MSG_CONSEQUENCE_TERMINATING_APP,
92-
errors.MSG_COUNTERMEASURE_FIX_PARENT_EXCEPTION
93-
+ " Most likely importing a dependency or data job step failed, see"
94-
+ " logs for details and fix the failed step (details in stacktrace).",
91+
" Most likely importing a dependency or data job step failed, see"
92+
+ " logs for details and fix the failed step.",
9593
]
9694
)
9795
)

0 commit comments

Comments
 (0)