Fixed logger unit test

The logger unit test depends on a specific line number, and recent
changes broke it.
This commit repairs that, and uses the __LINE__ constant to make
sure that future changes won't break things again.