more intelligent logging