mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
Kotlin: Move a function
This commit is contained in:
@@ -51,22 +51,7 @@ open class Logger(val logCounter: LogCounter, open val tw: TrapWriter) {
|
||||
tw.flush()
|
||||
System.out.flush()
|
||||
}
|
||||
fun info(msg: String) {
|
||||
val fullMsg = "${timestamp()} $msg"
|
||||
tw.writeComment(fullMsg)
|
||||
println(fullMsg)
|
||||
}
|
||||
fun trace(msg: String) {
|
||||
if(false) {
|
||||
info(msg)
|
||||
}
|
||||
}
|
||||
fun debug(msg: String) {
|
||||
info(msg)
|
||||
}
|
||||
fun trace(msg: String, exn: Exception) {
|
||||
trace(msg + " // " + exn)
|
||||
}
|
||||
|
||||
fun warn(severity: Severity, msg: String, locationString: String? = null, mkLocationId: () -> Label<DbLocation> = { tw.unknownLocation }) {
|
||||
val diagnosticLoc = getDiagnosticLocation()
|
||||
val diagnosticLocStr = if(diagnosticLoc == null) "<unknown location>" else diagnosticLoc
|
||||
@@ -90,6 +75,23 @@ open class Logger(val logCounter: LogCounter, open val tw: TrapWriter) {
|
||||
val locStr = if (locationString == null) "" else "At " + locationString + ": "
|
||||
print("$ts Diagnostic($diagnosticLocStr): $locStr$msg\n$suffix")
|
||||
}
|
||||
|
||||
fun info(msg: String) {
|
||||
val fullMsg = "${timestamp()} $msg"
|
||||
tw.writeComment(fullMsg)
|
||||
println(fullMsg)
|
||||
}
|
||||
fun trace(msg: String) {
|
||||
if(false) {
|
||||
info(msg)
|
||||
}
|
||||
}
|
||||
fun debug(msg: String) {
|
||||
info(msg)
|
||||
}
|
||||
fun trace(msg: String, exn: Exception) {
|
||||
trace(msg + " // " + exn)
|
||||
}
|
||||
fun warn(msg: String, exn: Exception) {
|
||||
warn(Severity.Warn, msg + " // " + exn)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user