does the following make sense?
@elidable(CONFIG) def logConfig( what: String ) { log.info( what )}
def test : Int = {
logConfig( "testin one two" )
666
}
where log is taken from SLF4s.
that is to say, i understand that in SLF4s logging is suppressed according to log-level set. but what i'd like to have is to not even invoke logConfig at all if i decide so with an elide-below level.
as i see it, log.info would call
def info(msg: => String) {
if (slf4jLogger.isInfoEnabled) slf4jLogger.info(msg)
}
so without @elidable i'd have
def test : Int = {
if (slf4jLogger.isInfoEnabled) slf4jLogger.info("testin one two")
666
}
whereas with elidable i would really get
def test : Int = {
666
}
if i wanted, right?
thanks, -sciss-
best, -sciss-
if i have
@elidable def log( what: String ) { println( "LOG: " + what )}
and
def test( i: Int ) = {
log( "found " + i )
i + i
}
when i let scalac eliminate the elidable stuff, the call log( ... ) in test is also removed (as far as i understand, and from what the step debugger tells me), so adding a by-name argument is redundant here, and probably also not preferable performance-wise.
right?
best, -sciss-
best, -sciss-