Loggen fix

Minor fixes for loggen.
In lot of test cases we just check the return code it wasn't handle properly everywhere.
If we test with file and it contains a lot of lines it is more easier to find the problematic one if we know its position