How many ways do you know ?
According to my little research, there are 3 different ways you can log messages in π‘πΌπ±π²π·π.
1- π°πΌπ»ππΌπΉπ².πΉπΌπ΄: We all know this one and have used it extensively in Javascript. What people don't know that under the hood it actually uses π½πΏπΌπ°π²ππ.πππ±πΌππ.ππΏπΆππ² with a line break.
2- π½πΏπΌπ°π²ππ.πππ±πΌππ.ππΏπΆππ²: Unlike the previous one, this outputs messages on the same line; so you're going to need to manually add like breaks.
3- π³π.ππΏπΆππ²π¦ππ»π°: Also requires manual line breaks. Writes to π½πΏπΌπ°π²ππ.πππ±πΌππ.ππΏπΆππ² like π°πΌπ»ππΌπΉπ².πΉπΌπ΄. This method though is a little unique. It takes an integer as the first argument, something called a π³πΆπΉπ² π±π²π°πΏππ½ππΌπΏ. To make it write to the πππ±πΌππ, you have to set it to 1. I'll talk about it in my next post.
Did you learn something new today?
Like and share this post, and follow me for more!
Top comments (0)