One’s attitude does not produce discernment, like sadness can’t diagnose disease. On the other hand, the right attitude should be one of the results of discernment, like an accurate diagnosis may cause sorrow. As always, discernment flourishes only when energized by the light of doctrine.

Discernment is not created in God’s people by brokenness, humility, reverence, and repentance. It is created by biblical truth and the application of truth by the power of the Holy Spirit to our hearts and minds. When that happens, then the brokenness, humility, reverence, and repentance will have the strong fiber of the full counsel of God in them. They will be profoundly Christian and not merely religious and emotional and psychological.

Quoted from John Piper’s post, Test Revival with Doctrine.