U.S. District Judge Louis L. Stanton’s order set off a firestorm among privacy advocates, including the Electronic Frontier Foundation. The group contends the disclosure of the information would violate a federal privacy law and could potentially expose private information about YouTube users.

“The Court’s erroneous ruling is a set-back to privacy rights, and will allow Viacom to see what you are watching on YouTube,” Kurt Opsahl, EFF senior staff attorney, wrote on the EFF blog.

Viacom filed suit against Google’s YouTube in March 2007, claiming the online video sharing Web site had failed to sufficiently stop users from posting and watching copyrighted material. The judge’s order came Wednesday in response to that lawsuit, according to published reports.

Google was ordered to release: a user’s log-in ID, the video ID, and the IP address that locates computers on the Internet, though doesn’t necessarily identify them by owner.

While Viacom also asked for records involving advertising transactions for Google’s AdWords and AdSense programs, the judge rejected that request. Viacom reportedly had sought an electronic index that shows how data in a database are organized by listing the database’s fields and tables, though not its underlying data.

Viacom had contended this information would have shown that Google could or should have known that its advertising revenues were associated with the pirated videos.

Google also will not be required to disclose its computer source code for the YouTube.com search function and the Google.com search engine.

Google doesn’t disclose how much revenue it generates from advertising or branded video on YouTube. But Forbes estimates it at $200 million this year and $350 million in 2009.