Disable warning from mdframed [duplicate]

Possible Duplicate:
Is there a way to avoid repetitive compiler warning messages?

When debugging some stuff I sometimes have empty mdframes and I get the log file littered with tons of

"Package mdframed Warning: You got a bad break"

How can I disable this message for mdframed only? (I still need warnings/errors from other packages)

-

marked as duplicate by egreg, clemens, lockstep, Marco Daniel, percusseAug 18 '12 at 9:54

The silence package as used here might be what you're looking for. – Scott H. Jul 23 '12 at 2:46

As Scott H. suggests in a comment you can use the silence package for this purpose. Minimal example:

\documentclass{article}

\usepackage{silence}

\usepackage{mdframed}

\makeatletter

because the last split box is empty\MessageBreak
You have to change the settings}

\makeatother

\begin{document}

\end{document}

-

The mdframed package uses

\newcommand*\mdf@PackageWarning[1]{\PackageWarning{\mdframedpackagename}{#1}}


to report warning messages. So, to disable all warning messages from mdframed, you could redefine this in your preamble (after loading the mdframed package) to ignore the message:

\makeatletter
\renewcommand*\mdf@PackageWarning[1]{}
\makeatother


Notes:

• As Marco Daniel commented, this kind of solution is generally not a good idea as it will eliminate all warning message form the mdframed package. So if you want to eliminate just one message it is better to use the silence package as per the other answer.

References:

-
I think it's not a good idea ;-) – Marco Daniel Jul 23 '12 at 9:41