KE2: Move the context stack from LoggerBase to Logger

This will let us have different threads with their own contexts that
share a LoggerBase.
This commit is contained in:
Ian Lynagh
2024-08-28 18:14:50 +01:00
parent 6391ed9865
commit 9c4aa931d5
2 changed files with 5 additions and 14 deletions

View File

@@ -500,15 +500,6 @@ OLD: KE1
logger.info("Extracting file $srcFilePath")
logger.flush()
/*
OLD: KE1
val context = logger.loggerBase.extractorContextStack
if (!context.empty()) {
logger.warn("Extractor context was not empty. It thought:")
context.clear()
}
*/
val srcFileRelativePath = PathTransformer.std().fileAsDatabaseString(File(srcFilePath))
val dbSrcFilePath = FileUtil.appendAbsolutePath(dbSrcDir, srcFileRelativePath).toPath()

View File

@@ -113,11 +113,6 @@ data class ExtractorContext(
* else will use a Logger that wraps it (and the DiagnosticTrapWriter).
*/
open class LoggerBase(val diagnosticCounter: DiagnosticCounter) {
/*
OLD: KE1
val extractorContextStack = Stack<ExtractorContext>()
*/
private val verbosity: Int
init {
@@ -325,6 +320,11 @@ OLD: KE1
* Logger is the high-level interface for writint log messages.
*/
open class Logger(val loggerBase: LoggerBase, val dtw: DiagnosticTrapWriter) {
/*
OLD: KE1
val extractorContextStack = Stack<ExtractorContext>()
*/
fun flush() {
dtw.flush()
loggerBase.flush()