Skip to content

Instantly share code, notes, and snippets.

@berteodosio
Created June 16, 2019 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berteodosio/74d6fdc9116909badaaca7effe9cdfd5 to your computer and use it in GitHub Desktop.
Save berteodosio/74d6fdc9116909badaaca7effe9cdfd5 to your computer and use it in GitHub Desktop.
fun logInfo(info: String, myLogLevel: LogLevel) {
if (myLogLevel includes LogLevel.INFO) {
Log.i(TAG, info)
}
}
fun testLogLevel() {
val info = "cheeseburger"
logInfo(info, myLogLevel = LogLevel.ERROR) // nothing is logged
logInfo(info, myLogLevel = LogLevel.VERBOSE) // message is logged, because verbose includes info
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment