Never-say-die optimism is a trait of an exceptional leader.
I'm not talking about blindly accepting looming disaster, ingrained organizational stupidity or incompetence with a kind of Alfred E. Neuman "what, me worry?" attitude. I'm talking about a positive, constructive outlook on life. As an optimistic leader you're showing your belief that you and your team can change things, that you can achieve amazing things together. If through your attitude you can communicate this to your team then they, too, will behave in a much more optimistic, "can do" way.
If, on the other hand, your attitude is one of pessimism and cynicism, that is equally contagious. If you whine and blame and always expect the worst of people then your people will do the same. Attitudes like that are conducive neither to a pleasant workplace environment nor to team and individual performance.
Don't be tempted to adopt the miserable attitude of a "realist." You and your people will do far better if you approach everything you do with an optimistic mindset, even if some of your aspirations might be seen as somewhat unrealistic.
Even eternal optimists feel the need to complain - even to whinge! - every now and then. It helps to relieve tension and unload any negativity that might be creeping in. As a leader, though, remember this: do not complain down. That is, don't complain or whinge to the people you lead. That's what your boss is for, so get in her/his ear. If your boss won't listen then talk to a trusted mentor. They'll help you to put things in perspective and restore a more positive outlook.