What happens if your caster level is modified in the middle of casting a spell?

For example, let’s say that you’re casting a spell with a long cast time (say, 24 hours). And that you have a contingency spell on you that triggers near the end of the casting, or that someone buffs you, and it raises your effective caster level. Which caster level is used for determining spell modifiers such as damage, range,…? Is it the level when you started casting, or the level when you finished casting?