David O'Doherty spends a lot of time filling notebooks, frantically scribbling down ideas for his next tour, gig or Edinburgh Festival.

"Stand-up is a complete obsession," says the comedian. "I woke up this morning and the first thing I did was look at my pen and paper and look at what I scrawled before I went to sleep last night.

"It's a blessing and a curse," says the 39-year-old Dubliner, a regular panellist on shows including QI, Would I Lie To you? and Have I Got News For You. "I'm very lucky to have something that I'm obsessed with, but that obsession can make it hard to have a normal life."

He admits he finds it difficult not to seek out a funny line in all aspects of life.

"That's when it gets really bad. When you're having an argument with your girlfriend and she's crying and you're crying and then you have this smiley thing in the back of your mind that what she said is so funny that you're going to say that on stage.

"Over time, I've found a better balance with it and I am capable of switching off, but there were years when my first show had gone really well in Edinburgh and I was being hailed as 'one to watch', yet I'd be staring at a desk, at a blank piece of paper, knowing that my new show opens in three-and-a-half weeks. That's a pressure I don't necessarily want in my life again."

To de-stress, he cycles and runs, and socialises with friends who aren't connected with comedy. His girlfriend, Esther, is very understanding, he says.

"She doesn't mind if I stay up 'til four in the morning writing. She's not in showbiz. I see that it is very tricky for her, but we have a reasonably normal life together. It's the most important thing, but she's also aware that sometimes I leave the room and go off and scribble ideas in a little brown book."

He's currently performing yet another new show at the Edinburgh Festival - We Are All In The Gutter, But Some Of Us Are Looking At David Doherty - which he'll be touring regionally.

It's built around random observations; this year part of the focus is the wonderful lives people seem to lead, judging by their posts on social media.

"I've always found life to be quite chaotic. Increasingly with social media, it's easy to get the impression everyone else is having a great time and everything's brilliant, except your life. If you look at celebrity news and people's Instagram accounts, everybody's at a garden party with fairy lights and it's easy to think you're the only one whose life is chaotic."

He writes and performs new material at Edinburgh every year. So does it become more difficult to come up with fresh stuff?

"It's tricky because when you start off, no one knows who you are and you try to convince a bunch of strangers that your stuff is funny. Then as you get older, you get better, and the audience is very often people who liked you last year. In a weird way, it gets easier."

When he comes off stage he's still on a high, which is when he channels his excess energy into writing for children, he explains.

He wrote his first children's book at 21, at around the same time he started doing stand-up, just as his older brother Mark was quitting his own stand-up career.

"My brother did non sequitur incredible one-liners. Dylan Moran [the Irish comedian and actor who wrote and starred in UK sitcom Black Books] always says my brother was his favourite stand-up.

"But the pressure of it going really badly was horrible. And my brother was a trained actor, and you don't get seen for proper parts if you're a stand-up. You just get auditioned for wacky neighbour roles, so he stopped doing it.

"I was lucky because in Dublin in the late Nineties, the comedy scene was small, but there were some incredible stand-up comedians here," he continues. "Dylan Moran and Ardal O'Hanlon were there.

"It was a very fortuitous and inspirational time because we were trying to do odd things. You were trying to make the other comedians laugh, as opposed to doing the kind of jokes that people who've had a few drinks will like."

He has written several children's plays as well as books, but also loves appearing on TV panel shows - because he can just be himself.

"I didn't do panel shows for a long time, because I was afraid I'd try too hard, whereas I'm comfortable now and don't force it. But I don't have any long-term goal. I don't want to win an Oscar or write a feature film. Through doing stand-up and writing books, I have a freedom now."

His new children's book, Danger Is Still Everywhere, is more bonkers than Jeff Kinney's Wimpy Kid series, with madcap illustrations accompanying the theme of how to tackle silly dangers and conquer your fears, which range from zombie dogs to paddling in bare feet.

The idea, which features the world's premier 'dangerologist' Dr Noel Zone looking out for danger, pointing out where it might be and making sure there isn't any, is inspired by O'Doherty's own fears when he was young.

"When I was a child I was absolutely scared of everything," he confesses. "We're talking about monsters in the dark. We'd go swimming in Brighton and I'd be scared of shark attacks. I was scared of ghosts. I thought it would be nice to create a character that was even more scared of things than me."

The son of a jazz musician, O'Doherty grew up in Central Dublin with his two siblings, and the family would regularly visit his grandmother, who lived on an island off the west coast.

"That was a big influence on all of our lives, because my father was a big radio comedy fan and on that five-and-a-half-hour drive, we would always listen to The Goon Show classics, the BBC Radio comedy of the Fifties, Sixties and Seventies, and there was always a touch of The Goon Show to Dr Noel as well."

His mini-keyboard - which he plays on stage - is the legacy of his first ambition to be a jazz musician, but he simply wasn't talented enough, he reflects.

"There are few places to hide in jazz if you don't have the ear or harmonic ability. Dad would be so annoyed watching The X Factor, where people are encouraged to try harder. Dad would say you just have to be good at it in the first place.

"I do remember him saying about my piano ability, 'You can't polish a turd'."

He spends about half the year touring, whether in the UK or further afield in Europe, the US or Australia, and still lives in Dublin the rest of the time. He campaigned for marriage equality at the recent referendum.

"It just seemed such an obvious piece of social justice," notes O'Doherty. "I couldn't think of any good reason why this shouldn't be the case. I saw an opportunity to play a tiny part in changing the country."

:: Danger Is Still Everywhere by David O'Doherty (words) and Chris Judge (pictures) is published by Puffin, priced £7.99. Available now

:: For details of O'Doherty's upcoming tours, visit www.davidodoherty.com