File tree Expand file tree Collapse file tree 2 files changed +4
-17
lines changed Expand file tree Collapse file tree 2 files changed +4
-17
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -10,23 +10,15 @@ function safeToString(info: any): string {
10
10
}
11
11
12
12
const DEBUG_LOG = '[ FEDERATION DEBUG ]' ;
13
-
14
- function safeGetLocalStorageItem ( ) {
15
- try {
16
- if ( typeof window !== 'undefined' && window . localStorage ) {
17
- return localStorage . getItem ( BROWSER_LOG_KEY ) === BROWSER_LOG_VALUE ;
18
- }
19
- } catch ( error ) {
20
- return typeof typeof document !== 'undefined' ;
21
- }
22
- return false ;
23
- }
24
13
class Logger {
25
14
enable = false ;
26
15
identifier : string ;
27
16
constructor ( identifier ?: string ) {
28
17
this . identifier = identifier || DEBUG_LOG ;
29
- if ( isBrowserEnv ( ) && safeGetLocalStorageItem ( ) ) {
18
+ if (
19
+ isBrowserEnv ( ) &&
20
+ localStorage . getItem ( BROWSER_LOG_KEY ) === BROWSER_LOG_VALUE
21
+ ) {
30
22
this . enable = true ;
31
23
} else if ( isDebugMode ( ) ) {
32
24
this . enable = true ;
You can’t perform that action at this time.
0 commit comments