@@ -35,13 +35,59 @@ export function getLogger(...name: string[]): Logger {
35
35
return getRootLogger ( name . join ( '.' ) ) ;
36
36
}
37
37
38
- /** Pre-setup cateogires for easy logging, by package name */
38
+ /** Pre-setup categories for easy logging, by package name */
39
+ /**
40
+ * The cs3dLog is a root category for Cornerstone3D logs. In forms a grouping
41
+ * for the logs underneath it, although at this point the log levels are entirely
42
+ * either local or inherited from the root loglevel.
43
+ * In loglevel 2.0, the default log levels will inherit from the parent logger, so
44
+ * that using `cs3dLog.setLevel("info")` for example, will set child categories
45
+ * to level info unless they have been otherwise specified.
46
+ *
47
+ * As well, the categories could be used with an externally defined appender
48
+ * to separate various logs by source. See dicom issue log below.
49
+ */
39
50
export const cs3dLog = getRootLogger ( 'cs3d' ) ;
51
+
52
+ /**
53
+ * The core, tools etc logs are intended to form root categories for the various
54
+ * packages to allow a particular package to be debugged or output redirected.
55
+ *
56
+ * The recommended usage is to create a sub-logger at the file level to log
57
+ * data for a particular area such as:
58
+ * ```
59
+ * const log = coreLog.getLogger('RenderingEngine', 'StackViewport');
60
+ * ```
61
+ * This usage is intended to allow hierarchical categories to turn on an entire
62
+ * sub-directory of loggers such as `RenderingEngine` once hierarchical categories
63
+ * have been enabled in loglevel 2.0
64
+ */
40
65
export const coreLog = cs3dLog . getLogger ( 'core' ) ;
41
66
export const toolsLog = cs3dLog . getLogger ( 'tools' ) ;
42
67
export const loaderLog = cs3dLog . getLogger ( 'dicomImageLoader' ) ;
43
68
export const aiLog = cs3dLog . getLogger ( 'ai' ) ;
69
+
70
+ /**
71
+ * The examples log is intended as a cross-package root logger for the examples,
72
+ * allowing separation of logging for examples from that for other areas.
73
+ */
44
74
export const examplesLog = cs3dLog . getLogger ( 'examples' ) ;
45
75
46
- /** Dicom issue log is for reporting inconsistencies and issues with DICOM logging */
47
- export const dicomIssueLog = getLogger ( 'dicom' , 'issue' ) ;
76
+ /**
77
+ * Dicom issue log is for reporting inconsistencies and issues with DICOM logging
78
+ * This log is separated from the cs3d hierarchy to allow separation of logs
79
+ * by use of an external appender to store inconsistencies and invalid DICOM
80
+ * values separately.
81
+ *
82
+ * Levels:
83
+ * * error - this is an issue in the data which prevents displaying at all
84
+ * * warn - a serious issue in the data which could cause significant display
85
+ * issues or mismatches of data.
86
+ * * info - an issue in the data which is handled internally or worked around such
87
+ * as not having patient name separated by `^` characters.
88
+ * * debug - an issue in the data which is common and is easily managed
89
+ */
90
+ export const dicomConsistencyLog = getLogger ( 'consistency' , 'dicom' ) ;
91
+
92
+ /** An image consistency/issue log for reporting image decompression issues */
93
+ export const imageConsistencyLog = getLogger ( 'consistency' , 'image' ) ;
0 commit comments