fixed logging source, added tests