complete logging code v1