go/toolchain: use ed9dc37b2b000f376a3e819cbb159e2c17a2dac6 (#514)
Updates #cleanup Signed-off-by: kari-ts <kari@tailscale.com>kari/androidlogs
parent
0b2a04b475
commit
3f53ed7e22
@ -0,0 +1,44 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
package com.tailscale.ipn.util
|
||||
|
||||
import android.util.Log
|
||||
import libtailscale.Libtailscale
|
||||
|
||||
object ExtendedLog {
|
||||
var libtailscaleWrapper = LibtailscaleWrapper()
|
||||
|
||||
fun d(tag: String?, message: String) {
|
||||
Log.d(tag, message)
|
||||
libtailscaleWrapper.sendLog(tag, message)
|
||||
}
|
||||
|
||||
fun w(tag: String, message: String) {
|
||||
Log.w(tag, message)
|
||||
libtailscaleWrapper.sendLog(tag, message)
|
||||
}
|
||||
|
||||
// Overloaded function without Throwable because Java does not support default parameters
|
||||
@JvmStatic
|
||||
fun e(tag: String?, message: String) {
|
||||
Log.e(tag, message)
|
||||
libtailscaleWrapper.sendLog(tag, message)
|
||||
}
|
||||
|
||||
fun e(tag: String?, message: String, throwable: Throwable? = null) {
|
||||
if (throwable == null) {
|
||||
Log.e(tag, message)
|
||||
libtailscaleWrapper.sendLog(tag, message)
|
||||
} else {
|
||||
Log.e(tag, message, throwable)
|
||||
libtailscaleWrapper.sendLog(tag, "$message ${throwable?.localizedMessage}")
|
||||
}
|
||||
}
|
||||
|
||||
class LibtailscaleWrapper {
|
||||
public fun sendLog(tag: String?, message: String) {
|
||||
val logTag = tag ?: ""
|
||||
Libtailscale.sendLog(logTag + ": " + message)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1 +1 @@
|
||||
4771bcafe5ca1554e13b2cb396336868e97781f3
|
||||
ed9dc37b2b000f376a3e819cbb159e2c17a2dac6
|
||||
Loading…
Reference in New Issue