1- /* eslint-disable no-console */
2- // I will remove this later when the logger is also in the web console.
3-
41import type { DeepReadonly } from '#lib/types' ;
2+ import { Logger } from '#lib/logger' ;
53
64let hideTimeout : NodeJS . Timeout | undefined ; // eslint-disable-line @typescript-eslint/init-declarations
75
@@ -78,7 +76,7 @@ export function getCurrentSlideUrlHash({
7876export const goToNextSlide = function goToNextSlide ( ) : void {
7977 const currentSlide = getCurrentSlideUrlHash ( ) ;
8078 const nextSlide = currentSlide + 1 ;
81- console . log ( `Going to the next slide: ${ nextSlide } ` ) ;
79+ Logger . info ( `Going to the next slide: ${ nextSlide } ` ) ;
8280 setCurrentSlideUrlHash ( nextSlide ) ;
8381} ;
8482
@@ -88,11 +86,11 @@ export const goToPreviousSlide = function goToPreviousSlide(): void {
8886 const previousSlide = currentSlide - 1 ;
8987
9088 if ( previousSlide < 1 ) {
91- console . log ( `At the start of the presentation, cannot go back further.` ) ;
89+ Logger . warn ( `At the start of the presentation, cannot go back further.` ) ;
9290 return ;
9391 }
9492
95- console . log ( `Going to the previous slide: ${ previousSlide } ` ) ;
93+ Logger . info ( `Going to the previous slide: ${ previousSlide } ` ) ;
9694 setCurrentSlideUrlHash ( previousSlide ) ;
9795} ;
9896
@@ -117,12 +115,12 @@ export const handleUrlHashChange = function handleUrlHashChange(
117115 if ( ! match ?. groups ) {
118116 let message = `The new URL hash: ${ newURL . hash } does not have a hash of the right shape: ${ regex } .` ;
119117 message += `Resetting it to the old value of ${ oldUrl . hash } ` ;
120- console . warn ( message ) ;
118+ Logger . warn ( message ) ;
121119 history . replaceState ( null , '' , event . oldURL ) ;
122120 return ;
123121 }
124122
125- console . log ( `Moved to: ${ event . newURL } ` ) ;
123+ Logger . info ( `Moved to: ${ event . newURL } ` ) ;
126124} ;
127125
128126/** Handles mouse presses on the document, and moves slides accordingly. */
0 commit comments