mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
chore: database debug logging
This commit is contained in:
parent
16458ab538
commit
e3408c9ff1
@ -320,7 +320,11 @@ export class Collection<
|
|||||||
|
|
||||||
const { database } = this.context;
|
const { database } = this.context;
|
||||||
|
|
||||||
database.logger.debug(`beforeSetField: ${this.name}, ${name}, ${safeJsonStringify(options)}`);
|
database.logger.debug(`beforeSetField: ${safeJsonStringify(options)}`, {
|
||||||
|
databaseInstanceId: database.instanceId,
|
||||||
|
collectionName: this.name,
|
||||||
|
fieldName: name,
|
||||||
|
});
|
||||||
|
|
||||||
if (options.source) {
|
if (options.source) {
|
||||||
const [sourceCollectionName, sourceFieldName] = options.source.split('.');
|
const [sourceCollectionName, sourceFieldName] = options.source.split('.');
|
||||||
|
@ -261,6 +261,9 @@ export class Database extends EventEmitter implements AsyncEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.options = opts;
|
this.options = opts;
|
||||||
|
this.logger.debug(`create database instance: ${safeJsonStringify(this.options)}`, {
|
||||||
|
databaseInstanceId: this.instanceId,
|
||||||
|
});
|
||||||
|
|
||||||
const sequelizeOptions = this.sequelizeOptions(this.options);
|
const sequelizeOptions = this.sequelizeOptions(this.options);
|
||||||
this.sequelize = new Sequelize(sequelizeOptions);
|
this.sequelize = new Sequelize(sequelizeOptions);
|
||||||
@ -538,7 +541,9 @@ export class Database extends EventEmitter implements AsyncEmitter {
|
|||||||
options.underscored = true;
|
options.underscored = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.debug(`beforeDefineCollection: ${safeJsonStringify(options)}`);
|
this.logger.debug(`beforeDefineCollection: ${safeJsonStringify(options)}`, {
|
||||||
|
databaseInstanceId: this.instanceId,
|
||||||
|
});
|
||||||
|
|
||||||
this.emit('beforeDefineCollection', options);
|
this.emit('beforeDefineCollection', options);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user