Skip to content

Commit dd6fcad

Browse files
committed
fix: PR comments
1 parent c6c7f2a commit dd6fcad

File tree

2 files changed

+50
-4
lines changed

2 files changed

+50
-4
lines changed

packages/core/src/RenderingEngine/StackViewport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ interface SetVOIOptions {
122122
voiUpdatedWithSetProperties?: boolean;
123123
}
124124

125-
const log = coreLog.getLogger('StackViewport');
125+
const log = coreLog.getLogger('RenderingEngine', 'StackViewport');
126126

127127
/**
128128
* An object representing a single stack viewport, which is a camera

packages/core/src/utilities/logger.ts

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,59 @@ export function getLogger(...name: string[]): Logger {
3535
return getRootLogger(name.join('.'));
3636
}
3737

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+
*/
3950
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+
*/
4065
export const coreLog = cs3dLog.getLogger('core');
4166
export const toolsLog = cs3dLog.getLogger('tools');
4267
export const loaderLog = cs3dLog.getLogger('dicomImageLoader');
4368
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+
*/
4474
export const examplesLog = cs3dLog.getLogger('examples');
4575

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

Comments
 (0)