@@ -36,6 +36,8 @@ import {
3636 decodedTabElement
3737} from '../dom-elements.js' ;
3838
39+ import * as log from 'loglevel' ;
40+
3941// The event manager lets us enable/disable events as needed without
4042// manually tracking them. Events that need to be disabled should be
4143// passed to the event manager.
@@ -97,7 +99,7 @@ function selectAlgorithm(algorithm) {
9799 algorithmSelect . querySelector ( `option[value="${ algorithm } "]` ) ;
98100
99101 if ( ! selected ) {
100- console . log ( `Invalid algorithm ${ algorithm } , ignoring...` ) ;
102+ log . info ( `Invalid algorithm ${ algorithm } , ignoring...` ) ;
101103 return ;
102104 }
103105
@@ -148,7 +150,7 @@ function setAlgorithmInHeader(algorithm) {
148150 // errors.
149151 if ( ! ( e instanceof SyntaxError ) ) {
150152 // If it's not a SyntaxError, log the error.
151- console . error ( 'Failed to encode token: ' , e ) ;
153+ log . warn ( 'Failed to encode token: ' , e ) ;
152154 }
153155 }
154156
@@ -254,7 +256,7 @@ function encodeToken() {
254256
255257 saveAsLastToken ( ) ;
256258 } catch ( e ) {
257- console . error ( 'Failed to sign/encode token: ' , e ) ;
259+ log . warn ( 'Failed to sign/encode token: ' , e ) ;
258260 markAsInvalid ( ) ;
259261 tokenEditor . setValue ( '' ) ;
260262 }
@@ -291,7 +293,7 @@ function decodeToken() {
291293 verifyToken ( ) ;
292294 }
293295 } catch ( e ) {
294- console . error ( 'Failed to decode token: ' , e ) ;
296+ log . warn ( 'Failed to decode token: ' , e ) ;
295297 }
296298 } ) ;
297299}
0 commit comments