Emotional honesty vs complaining

“Do not complain,” the preacher said this morning, “have a positive attitude. Complaining brings you nothing.” She told how she was complaining often to God and to a friend about her boss at work, and she was not making progress. Finally her friend encouraged her to stop complaining and to trust God, which she did. Her boss noticed her changed attitude and asked what was different.
As I listened, I thought of a question. When is emotional honesty with God complaining? I looked again at her text, from Philippians 2. “Do everything without complaining or arguing, so that you may become blameless and pure, children of God without fault in a crooked and depraved generation.” The verb “do” impresses me. I can be emotionally honest, pour out my heart to God and express my frustrations and distress, then arise from my prayers and go do what I have to do in the situation I have to do this in without complaining to anyone else.
I also thought how in Psalm 22, David begins with “My God, my God, why have you forsaken me?” But he moves on to “You are enthroned as the Holy One, you are the praise of Israel.” David pours out his heart, but does not contemplate only his distress, but reminds himself who God is. Another thing to remember is to be thankful. We may be in distress, let us acknowledge to God that we are distressed, but let us also remember to give thanks for what he has given us. Is the stressful circumstance the only thing in our lives? No, there are many good gifts as well. But the complaining spirit ignores the good gifts, and sees only the one thing that is painful or lacking.
I think we can even give thanks for the problems and stresses in our lives. God works in all things for good, even though not all things are good. Paul says in Ephesians to give thanks for all things (Ephesians 5:20). Jesus gave thanks even a short hour before his arrest.