mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 17:26:01 +00:00
defined logger caller
This commit is contained in:
@@ -5,7 +5,7 @@ import _pick from 'lodash/pick';
|
||||
import _compact from 'lodash/compact';
|
||||
import { getLogger } from './getLogger';
|
||||
|
||||
const logger = getLogger();
|
||||
const logger = getLogger('dbAnalyser');
|
||||
|
||||
const STRUCTURE_FIELDS = ['tables', 'collections', 'views', 'matviews', 'functions', 'procedures', 'triggers'];
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { getLogger } from './getLogger';
|
||||
import { SqlDumper } from './SqlDumper';
|
||||
import { extendDatabaseInfo } from './structureTools';
|
||||
|
||||
const logger = getLogger();
|
||||
const logger = getLogger('sqlGenerator');
|
||||
|
||||
interface SqlGeneratorOptions {
|
||||
dropTables: boolean;
|
||||
|
||||
@@ -2,7 +2,7 @@ import _intersection from 'lodash/intersection';
|
||||
import { getLogger } from './getLogger';
|
||||
import { prepareTableForImport } from './tableTransforms';
|
||||
|
||||
const logger = getLogger();
|
||||
const logger = getLogger('bulkStreamBase');
|
||||
|
||||
export function createBulkInsertStreamBase(driver, stream, pool, name, options): any {
|
||||
const fullNameQuoted = name.schemaName
|
||||
|
||||
@@ -7,6 +7,10 @@ export function setLogger(value: Logger) {
|
||||
_logger = value;
|
||||
}
|
||||
|
||||
export function getLogger(): Logger {
|
||||
return _logger || defaultLogger;
|
||||
export function getLogger(caller?: string): Logger {
|
||||
let res = _logger || defaultLogger;
|
||||
if (caller) {
|
||||
res = res.child({ caller });
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user