Code in question:
https://github.com/mongodb/mongo/blob/r3.1.6/src/mongo/s/client/shard_registry.cpp#L95
Example logs:
2015-08-13T17:48:08.668+0000 W SHARDING [Balancer] could not initialize balancer, please check that all shards and config servers are up: couldn't get updated shard list from config server 2015-08-13T17:48:08.668+0000 I SHARDING [Balancer] will retry to initialize balancer in one minute