For test suites whose underlying mongod/s processes are managed by resmoke.py, it can be hard to figure out the mapping between mongo process ports, replica states, and PIDs in the log messages. For example, in the replica_sets_jscore_passthrough suite, a log line only shows the state of that replica set node:
Ideally, we would have an easy way to know, when looking at any log line, the replica set state (primary, secondary, etc.), the PID, and the port that the mongo process started up on. In sharding suites we also want to know whether the node is a config server, mongoS, etc. Currently, figuring out this information requires one to trace back to the beginning of the logs (which may be in an entirely separate file if the fixture was not restarted recently) and look for startup messages with this information. One thought would be to print out a complete mapping of ports, PIDs, and current replica set states at the beginning of every new test execution. We could also include this info directly in the log message prefix.