Kevin hit the nail on the head, you gotta be easy on yourself and realize nobody is perfect and you will always have bad games or get outshined by someone else. If it really becomes a huge issue I would even say you might want to just not look at logs, just focus on helping your team win and doing the best you can. Some people get super down on themselves for their K/D and will straight up disable it in their hud (roamers do this primarily cuz they have trash stats from sacking).
I think the healthier way to strive for improvement is by noticing situations in which you get caught out or could change your play somehow, rather than looking at a more abstract statistic and wishing your number was magically higher. But even then, getting angry at yourself is never helpful so I think practicing forgiveness and trying to let go (take a few breaths, think about something else) is probably your best bet. Nobody gets good instantly, but you don't see banny yelling at himself and getting super mad if he messes up, he has the mental game to not get flustered even if he is playing badly or losing, and everyone should strive towards that.
TF2 is somewhat about mechanical skill but beyond a certain point it's just timing, gamesense, team play, and mental game, and all of those things you can practice every game you play and try to be more cognizant about, rather than beating yourself up for missing or doing low dpm.