Improve BLogger-related code

Fix devices flushing. Add some related defines.