SYNC: better DB analysis logging

This commit is contained in:
SPRINX0\prochazka
2025-09-24 10:29:46 +02:00
committed by Diflow
parent 9886c58681
commit 53eedd2701

View File

@@ -89,9 +89,15 @@ export class DatabaseAnalyser<TClient = any> {
async fullAnalysis() { async fullAnalysis() {
logger.debug(this.getLogDbInfo(), 'DBGM-00126 Performing full analysis'); logger.debug(this.getLogDbInfo(), 'DBGM-00126 Performing full analysis');
try {
const res = this.addEngineField(await this._runAnalysis()); const res = this.addEngineField(await this._runAnalysis());
// console.log('FULL ANALYSIS', res); logger.debug(this.getLogDbInfo(), 'DBGM-00271 Full analysis finished successfully');
return res; return res;
} catch (err) {
logger.error(extractErrorLogData(err, this.getLogDbInfo()), 'DBGM-00272 Error during full analysis');
throw err;
}
// console.log('FULL ANALYSIS', res);
} }
async singleObjectAnalysis(name, typeField) { async singleObjectAnalysis(name, typeField) {
@@ -112,6 +118,7 @@ export class DatabaseAnalyser<TClient = any> {
logger.info(this.getLogDbInfo(), 'DBGM-00127 Performing incremental analysis'); logger.info(this.getLogDbInfo(), 'DBGM-00127 Performing incremental analysis');
this.structure = structure; this.structure = structure;
try {
const modifications = await this.getModifications(); const modifications = await this.getModifications();
if (modifications == null) { if (modifications == null) {
// modifications not implemented, perform full analysis // modifications not implemented, perform full analysis
@@ -136,8 +143,15 @@ export class DatabaseAnalyser<TClient = any> {
this.modifications = structureModifications; this.modifications = structureModifications;
if (structureWithRowCounts) this.structure = structureWithRowCounts; if (structureWithRowCounts) this.structure = structureWithRowCounts;
logger.info({ ...this.getLogDbInfo(), modifications: this.modifications }, 'DBGM-00128 DB modifications detected'); logger.info(
{ ...this.getLogDbInfo(), modifications: this.modifications },
'DBGM-00128 DB modifications detected'
);
return this.addEngineField(this.mergeAnalyseResult(await this._runAnalysis())); return this.addEngineField(this.mergeAnalyseResult(await this._runAnalysis()));
} catch (err) {
logger.error(extractErrorLogData(err, this.getLogDbInfo()), 'DBGM-00273 Error during incremental analysis');
throw err;
}
} }
mergeAnalyseResult(newlyAnalysed) { mergeAnalyseResult(newlyAnalysed) {