OHIF记录(十三)——OHIF.log用法
作者:互联网
OHIF.log用法
@ohif/core将console的用法封装到了自己的依赖库里
安装@ohif/core后,在node_modules下的路径@ohif/core —> src —> index.js中有如下代码:
...
import log from './log.js';
...
const OHIF = {
...
log,
...
}
export default OHIF
其中log是同目录下的log.js文件,代码:
const log = {
error: console.error,
warn: console.warn,
info: console.log,
trace: console.trace,
debug: console.debug,
time: console.time,
timeEnd: console.timeEnd,
};
export default log;
由此可见,
- OHIF.log.info => console.log
- OHIF.log.error => console.error
- OHIF.log.warn => console.warn
- OHIF.log.debug => console.debug
- OHIF.log.time => console.time
用法:
import OHIF, { MODULE_TYPES, DICOMSR } from '@ohif/core';
OHIF.log.info('test word');
标签:...,console,log,core,用法,OHIF,time 来源: https://blog.csdn.net/qq_38853948/article/details/122687683