Whether that call to another TU is logging or something else is irrelevant. The important part is that your suggested way of detecting the need for a stacktrace doesn't work in general.