File tree Expand file tree Collapse file tree 2 files changed +6
-15
lines changed Expand file tree Collapse file tree 2 files changed +6
-15
lines changed Original file line number Diff line number Diff line change 11import { Database } from 'arangojs' ;
22import { CreateCollectionOptions } from 'arangojs/collection' ;
33import { Config } from 'arangojs/connection' ;
4- import { globalContext } from '../../config/global' ;
54import { ProjectOptions } from '../../config/interfaces' ;
6- import { Logger } from '../../config/logging' ;
5+ import { DEFAULT_LOGGER_PROVIDER , Logger } from '../../config/logging' ;
76import { CustomDatabase } from './arangojs-instrumentation/custom-database' ;
87import { ArangoSearchConfiguration } from './schema-migration/arango-search-helpers' ;
98
@@ -92,10 +91,6 @@ export function initDatabase(config: ArangoDBConfig): Database {
9291}
9392
9493export function getArangoDBLogger ( schemaContext : ProjectOptions | undefined ) : Logger {
95- globalContext . registerContext ( schemaContext ) ;
96- try {
97- return globalContext . loggerProvider . getLogger ( 'ArangoDBAdapter' ) ;
98- } finally {
99- globalContext . unregisterContext ( ) ;
100- }
94+ const loggerProvider = schemaContext ?. loggerProvider ?? DEFAULT_LOGGER_PROVIDER ;
95+ return loggerProvider . getLogger ( 'ArangoDBAdapter' ) ;
10196}
Original file line number Diff line number Diff line change 11import { globalContext } from '../../config/global' ;
22import { ProjectOptions } from '../../config/interfaces' ;
3- import { Logger } from '../../config/logging' ;
3+ import { DEFAULT_LOGGER_PROVIDER , Logger } from '../../config/logging' ;
44import { Model } from '../../model' ;
55import { ALL_QUERY_RESULT_VALIDATOR_FUNCTION_PROVIDERS , QueryNode } from '../../query-tree' ;
66import { FlexSearchTokenization } from '../../query-tree/flex-search' ;
@@ -33,12 +33,8 @@ export class InMemoryAdapter implements DatabaseAdapter {
3333 if ( options . db ) {
3434 this . db = options . db ;
3535 }
36- globalContext . registerContext ( schemaContext ) ;
37- try {
38- this . logger = globalContext . loggerProvider . getLogger ( 'InMemoryAdapter' ) ;
39- } finally {
40- globalContext . unregisterContext ( ) ;
41- }
36+ const loggerProvider = schemaContext ?. loggerProvider ?? DEFAULT_LOGGER_PROVIDER ;
37+ this . logger = loggerProvider . getLogger ( 'InMemoryAdapter' ) ;
4238 }
4339
4440 /**
You can’t perform that action at this time.
0 commit comments