You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because I use Prettier and it puts whitespace around {} in objects, I uncontentiously did the same in template literals. It took a bit of time to figure out what was going on.
Here is an idea: if we detect dev mode and there is a key mismatch like ' hello ' / 'hello', logtape could log a warning and explaining the situation. Or maybe it could even βforgiveβ spaces around braces. This could help folks with onboarding, because every new team member who uses logtape for the first time can accidentally fall into the same trap as I did.
WDYT?
The text was updated successfully, but these errors were encountered:
How about a behavior that strips out the whitespace to find the variable if there is leading and trailing whitespace in a template variable and it doesn't match exactly?
logger.info("value = { foo }",{" foo ": 1,foo: 2});// INF value = 1logger.info("value = { foo }",{foo: 2});// INFO value = 2
π @dahlia! Just started playing with logtape β awesome architecture!
I faced a small issue with template literals and decided to share. Technically, there is no bug, it's just a small DX trap that could be avoided.
It turned out that
{foo}
and{ foo }
were not the same thing, which caught me:Because I use Prettier and it puts whitespace around
{
}
in objects, I uncontentiously did the same in template literals. It took a bit of time to figure out what was going on.Here is an idea: if we detect dev mode and there is a key mismatch like
' hello '
/'hello'
, logtape could log a warning and explaining the situation. Or maybe it could even βforgiveβ spaces around braces. This could help folks with onboarding, because every new team member who uses logtape for the first time can accidentally fall into the same trap as I did.WDYT?
The text was updated successfully, but these errors were encountered: