Extract `logFromText` into logging package.

So we can reuse it.