In the seventh inning of the St. Louis Cardinals’ game at the Chicago White Sox on Wednesday, umpiring crew chief Joe West asked Cardinals reliever Giovanny Gallegos to take off his hat.

West broke the record for games umpired the previous night. The series marked the first time Tony La Russa, the Hall of Fame manager, faced his previous team since returning to the dugout after a decade-long hiatus. And the Cardinals and White Sox were leading the National League Central and American League Central, respectively.

But by the end of Wednesday’s game, it was clear Gallegos’s hat would become the story of the series and the latest example of MLB’s somewhat disjointed efforts to limit pitchers’ use of foreign substances — a problem players and coaches agree is widespread, though they also believe not all offenses are created equal.

Before this season, MLB sent a memo to teams, letting them know about additional monitoring and enforcement procedures designed to prevent players from applying foreign substances to the baseball. MLB’s plans included analyzing Statcast data to conduct spin rate analysis of pitchers “suspected of using foreign substances.”

That memo also indicated in-stadium monitors would collect balls suspected of being tainted and send them to the commissioner’s office for testing by a third-party lab. It promised discipline for players found to be violating MLB policy.

Until Wednesday, that policy had not resulted in many visible examinations of equipment, though MLB has been collecting baseballs from games since the season began.

In that context, West’s umpiring crew noticed a dark spot on Gallegos’s hat when he ran in from the bullpen Wednesday afternoon. West approached Gallegos when the reliever reached the pitcher’s mound and asked him to remove the hat, suggesting he replace it with a fresh one. A Cardinals trainer brought Gallegos a new hat, and his manager, Mike Shildt, hurried out to argue. He didn’t last long before West ejected him.

“Why do I take exception to that? Because this is baseball’s dirty little secret, and it’s the wrong time and the wrong arena to expose it,” Shildt said after the game, acknowledging that he may get fined for criticizing West’s action.

He continued: “First, of all, Gio wears the same hat all year. Hats accrue dirt. Hats accrue substances — just stuff. Did Gio have sunscreen at some point in his career to make sure he doesn’t get melanoma? Possibly. Does he use rosin? Possibly.”

MLB didn’t implement new monitoring procedures to immediately increase enforcement, according to people with knowledge of the thinking behind the shift. Instead, the more imminent goal was to collect information about the range of substances being used, and their relative effectiveness, to better understand the problem and identify ways to limit it.

The scope of foreign substance use can vary widely, from pitchers using sunscreen, sweat and rosin to help improve grip to the use of specially created substances that can increase spin rate and movement, according to multiple managers, players and executives.

Shildt said he was angry because he felt it was an inappropriate place to make a highly visible foray into the world of enforcement or even information gathering — a benign situation cast as sinister by West’s decision to pull the hat.

“Major League Baseball has got a very, very tough position here because there are people that are effectively — and not even trying to hide [it], essentially flipping the bird at the league with how they’re cheating in this game with concocted substances,” Shildt said.

“You want to police sunscreen and rosin? Go ahead. But why don’t you start with the guys who are really cheating with some stuff that are really impacting the game?” Shildt added, noting that some players have used foreign substances so effectively that it has helped them make more money.

West later told a pool reporter that he was simply trying to allow Gallegos to continue pitching, not make a statement of any kind. He said he didn’t want the White Sox to notice the spot and complain and was trying to preempt issues instead of cause them.

“Rather than get into a confrontation, make [Gallegos] remove the hat so that he doesn’t do anything with an illegal substance on his hat. All I asked him was to change the hat. I don’t think he had any problem with it,” West told the pool reporter. “He said it was sunscreen. When Mike got upset about it, I don’t think he really knew what we were doing. I was just trying to keep the pitcher in the game.”

Still, West’s choice to remove the hat — which is nowhere near the grimiest pitcher’s hat in baseball — raises enforcement questions for his fellow umpires. What if, for example, longtime Cardinals starter Adam Wainwright’s hat, which Shildt said is almost always grimy, is covered in dirt the next time he takes the mound?

“Are these things that baseball really wants to crack down on? No, it’s not. That is not anything that’s going to affect [Gallegos’s] ability to compete,” Shildt said. Indeed, Gallegos went on to strike out hot-hitting Yermín Mercedes and reigning MVP José Abreu while wearing the new hat.

Eno Sarris, data guru of the Athletic, reported that the spin rate on Gallegos’s fastball fell about 30 rotations per minute from its norm in the inning he pitched with the new hat. That number is relatively small, particularly when compared with some of the jumps seen from pitchers suspected of using more carefully crafted sticky substances.

“I know Major League Baseball is trying their best to do it in a manner that doesn’t create any black eye for the integrity of the game that we love, but speaking of integrity, how about the integrity of the guys that are doing it clean?” Shildt said.

“I’m speaking up for the hitters who have a living to make facing stuff that already is really, really good, and you can see based on spin rate how guys’ careers are jumping off the charts.”