Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom logger #49

Merged
merged 4 commits into from
Jun 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions src/main/kotlin/com/team4099/robot2023/util/DebugLogger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,82 @@ import org.littletonrobotics.junction.Logger

class DebugLogger {
companion object {
inline fun <E : Enum<E>> recordOutput(key: String, value: E) {
Logger.recordOutput(key, value)
}

inline fun <T : WPISerializable> recordOutput(key: String, value: T) {
Logger.recordOutput(key, value)
}

inline fun <U : edu.wpi.first.units.Unit<U>> recordOutput(key: String, value: Measure<U>) {
Logger.recordOutput(key, value)
}

inline fun <T> recordOutput(key: String, value: Struct<T>) {
Logger.recordOutput(key, value)
}

inline fun <T : StructSerializable> recordOutput(key: String, vararg value: T) {
Logger.recordOutput(key, *value)
}

inline fun recordOutput(key: String, value: Mechanism2d) {
Logger.recordOutput(key, value)
}

inline fun recordOutput(key: String, value: Array<String>) {
Logger.recordOutput(key, value)
}

inline fun recordOutput(key: String, value: BooleanArray) {
Logger.recordOutput(key, value)
}

inline fun recordOutput(key: String, value: Boolean) {
Logger.recordOutput(key, value)
}

inline fun recordOutput(key: String, value: ByteArray) {
Logger.recordOutput(key, value)
}

inline fun recordOutput(key: String, value: DoubleArray) {
Logger.recordOutput(key, value)
}

inline fun recordOutput(key: String, value: Double) {
Logger.recordOutput(key, value)
}

inline fun recordOutput(key: String, value: Float) {
Logger.recordOutput(key, value)
}

inline fun recordOutput(key: String, value: FloatArray) {
Logger.recordOutput(key, value)
}

inline fun recordOutput(key: String, value: Int) {
Logger.recordOutput(key, value)
}

inline fun recordOutput(key: String, value: IntArray) {
Logger.recordOutput(key, value)
}

inline fun recordOutput(key: String, value: Long) {
Logger.recordOutput(key, value)
}

inline fun recordOutput(key: String, value: LongArray) {
Logger.recordOutput(key, value)
}

inline fun recordOutput(key: String, value: String) {
Logger.recordOutput(key, value)
}

inline fun <E : Enum<E>> recordDebugOutput(key: String, value: E) {
if (Constants.Tuning.DEBUGING_MODE) {
Logger.recordOutput(key, value)
Expand Down
Loading