Narrated Abu Hurairah: I heard Allah’s Messenger, peace be upon him, saying, “All the sins of my followers will be forgiven except those of the Mujahirin (those who commit a sin openly or disclose their sins to the people). An example of such disclosure is that a person commits a sin at night and Allah screens it from the public. (Yet) he comes in the morning, and says, ‘O so-and-so, I did such and such (evil) deed yesterday.’ [So, even) though he spent his night screened by his Lord (none knowing his sin) and in the morning he removes Allah’s screen from himself.”
[8: 95- O.B. Sahih Al-Bukhari)