In the book on Modular Forms by Diamond and Shurman, they first define a weakly modular function as a holomorphic function $f:{\cal H}\rightarrow {\mathbb C}$ on the upper half plane with certain transformation properties under the modular group, and then they look at the composition $g:D'\rightarrow {\mathbb C}$, $g(q)=f(\log(q)/(2\pi i))$, where $D'$ is the punctured unit disk $D'=\{q:0<|q|<1\}$, and they write:
If $f$ is holomorphic on the upper half plane then the composition $g$ is holomorphic on the punctured disk since the logarithm can be defined holomorphically about each point, and so $g$ has a Laurent expansion $g(q) = \sum_{n\in {\mathbb Z}}a_nq^n$ for $q\in D'$.
Then they go on to define $f$ to be a modular form if the Laurent series extends holomorphically to the puncture point $q=0$, in other words if the series actually sums over $\mathbb N$. I think I am missing something basic in the quoted reasoning. Using the same reasoning I could say that $\log(q)$ can be defined holomorphically at each point of $D'$ and therefore has a Laurent series at $q=0$, which of course is not true. What am I missing?
From the fact that the logarithm can be defined holomorphically about each point alone, indeed it only follows that the composition $g(q) = f(\log(q)/(2\pi i))$ can also be defined holomorphically about each point.
The fact that it defines a holomorphic function on the punctured disk depends crucially on the invariance of $f$ under translations. What they remark before, is that the function $g$ is uniquely defined, even though the logarithm isn't. To now conclude that the function is holomorphic, you only have to show it is holomorphic at each point, so you are done.
The difference with doing this for the logarithm is that you cannot fix a function that gives the logarithm on the whole punctured disk, and that at the same time is holomorphic at each point. You will unavoidably have a discontinuity.