fixed log's inverted capture behavior, added iteration of shared_index