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
Before refreshing the browser isInfoEnabled() and isDebugEnabled() are working as expected. But after refreshing the browser internal statelevel is now a string value: DEBUG.
I created a fork and removed the cast to string in the following line (logger.ts):
However I don't think as string is the issue, casting is a compile time/typescript only feature, it shouldn't affect the runtime/js functionality.
The issue is caused by the Level[] notation. Typescript brings back either the key if you look for the value, or the value if you look for the key (at least in 2.0). That's because they translate the enum to an array similar to this:
0: "OFF"
1: "ERROR"
...
DEBUG: 4
ERROR: 1
...
I tried the solution in your pull request and it didn't fix it for me. Do you mind double checking? else if you apply the changes in the comments I added, I'll apply your pull request, thanks for your contribution =)
I tried to use store() to persist the dynamically changed logger settings.
My test was
The value is stored in localStorage as
4
.Before refreshing the browser
isInfoEnabled()
andisDebugEnabled()
are working as expected. But after refreshing the browser internal statelevel
is now astring
value:DEBUG
.I created a fork and removed the cast to
string
in the following line (logger.ts):This solved the issue for me. I will provide a pull request for that.
The text was updated successfully, but these errors were encountered: