mirror of
https://github.com/github/codeql.git
synced 2026-05-22 07:07:09 +02:00
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:
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user