Use logger in error/warning messages (#2790)
* Use logger in error/warning messages * Update packages/types/src/codec/BTreeSet.ts * Update expectation * Some additional type tests
This commit is contained in:
@@ -3,9 +3,13 @@
|
||||
|
||||
import { Registry } from '@polkadot/types/types';
|
||||
|
||||
import { logger } from '@polkadot/util';
|
||||
|
||||
import extractTypes from './extractTypes';
|
||||
import flattenUniq from './flattenUniq';
|
||||
|
||||
const l = logger('metadata');
|
||||
|
||||
/** @internal */
|
||||
export default function validateTypes (registry: Registry, types: string[], throwError: boolean): void {
|
||||
const missing = flattenUniq(extractTypes(types)).filter((type) => !registry.hasType(type));
|
||||
@@ -16,7 +20,7 @@ export default function validateTypes (registry: Registry, types: string[], thro
|
||||
if (throwError) {
|
||||
throw new Error(message);
|
||||
} else {
|
||||
console.warn(message);
|
||||
l.warn(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user