I would like to add a warning in my log when using the \todo command. To do so i did:
\documentclass{book}
\usepackage[colorinlistoftodos,prependcaption,textsize=tiny]{todonotes}
\let\oldtodo\todo
\renewcommand{\todo}[2]{\oldtodo[#1]{#2} \message{Warning: TODO: #2.^^J}}
\begin{document}
\todo{}{Maybe write something meaningful}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
\end{document}
and everything is fine. However, if i change the renew line in:
\renewcommand{\todo}[2][inline]{\oldtodo[#1]{#2} \message{Warning: TODO: #2.^^J}}
I receive the error
! TeX capacity exceeded, sorry [input stack size=5000].