Twitter and TV can 'cloud your judgement' as president, former President Barack Obama said in a not-subtle dig at President Donald Trump during a speech to a high-tech conference in San Francisco Wednesday.

The president made the remarks at a conference for big data software firm Splunk, a day after Trump breezed through town for $100,000-per-couple fundraiser in Palo Alto.

He said as president he benefited by hearing from a team 'with a diversity of opinion.'

'The other thing that is helpful is not watching TV or reading social media,' he quipped, in a reference to Trump's regular TV viewership and Twitter focus.

Former President Barack Obama, pictured here in December 2016, had advice for 'presidents' during a speech in San Francisco. He said they were well served getting a diversity of opinion, and avoiding TV and social media

'Those are two things I would advise, if you're our president, not to do. It creates a lot of noise and clouds your judgment.'

It is advice Trump is unlikely to take. The president began his day thanking former campaign manager Corey Lewandowski after his appearance on 'Fox and Friends,' then tweeted a conspiracy theorist who had gone after Democratic Rep. Ilhan Omar with an inaccurate post, then alter went after 'Dummy' former Rep. Beto O'Rourke.

The president says he doesn't watch much TV but regularly offers commentary on Fox News morning shows and other events.

Obama also compared his own staff favorably to Trump's, a day after former campaign manager Corey Lewandowski testified in the House and admitted he didn't tell the truth in televised interviews.

'I won't say we enforced perfectly the 'no-jerk rulem' but its a pretty good rule. I won't say who violated that rule,' Obama said, Axios reported.

Obama's vice president Joe Biden regularly points to the relative lack of scandal as a talking point on the campaign trail.

Multiple Trump officials have pleaded guilty or been convicted of crimes linked to the Russia probe, which Trump regularly calls a witch hunt. Longtime Trump lawyer Michael Cohen is serving a three-year prison sentence for campaign finance and other violations.

'I won't say we enforced perfectly the 'no-jerk rulem' but its a pretty good rule. I won't say who violated that rule,' former President said of staffing his administration. He said he was proud his administration 'didn't have indictments,' in another seeming criticism of President Trump

Obama encouraged presidents to avoid social media

'I'm proud of the fact we didn't have indictments. I've said that before but that is pretty rare in modern day,' said Obama, who Trump regularly goes after in public comments and online.

He also spoke of the 'moral force' needed to take on climate change, on a day when Trump announced he was ending an Obama-era rule allowing California to set tougher auto emissions standards than the federal one.

On a day when Trump announced he was naming Robert O'Brien to act as his fourth national security advisor, Obama counseled presidents to 'create a process where you have confidence that whatever data is out there has been sifted and sorted.'