El Caga Tio (defecating log in English) is a big piece of cut wood is a character in Catalan mythology relating to Christmas tradition widespread in Catalonia. Usually in the beginning with the Feast of the Immaculat Conception (December 8), children or adults gives the tió a little bit to „eat“ (usually mandarines) every night and next morning the fruit is eaten, only peels are left. Adults expect that children think that the dog has eaten the mandarines over night. Usually kids play that game.
In the night of December 24th, the Holy Night („Noche Buena“), children are hitting the Tio with sticks and sing:
avellanes i mató,
si no cagues bé
et daré un cop de bastó.
which basically means: if you don’t poop well, I’ll hit you with a stick!
Then a magic moment happens and the blanket is going to me removed. Children can see their gifts (still wrapped) and usually cannot wait to longer to unbox. The gift is opened and then the song begins again. As you can see, excrement have transformed into presents. Anal actions have long tradition in the Spanish Christmas Folklore, see Caganer.
Spaniards make more (and expensive) gifts on the day of „Los Tres Reyes Magos“ which is the Three Magi Celebration on January 6h.