@@ -733,7 +733,7 @@ export const sendEmail = async (to: string, subject: string, locals: any, templa
733733 }
734734
735735 if ( ! html . length ) {
736- console . log ( ErrorMessage . NoHtmlLoaded , { templateFilePath, htmlTemplateFilePath } )
736+ log ( ErrorMessage . NoHtmlLoaded , { templateFilePath, htmlTemplateFilePath } , 'error' )
737737 return null
738738 }
739739
@@ -791,7 +791,7 @@ export const sendEmailsToAmbassadors = async (
791791
792792 for ( const ambassador of ambassadors ) {
793793 if ( ambassador . email ) {
794- console . log ( `sending ${ emailName } email to BikeTag Ambassador: ${ ambassador . email } ` )
794+ log ( `sending ${ emailName } email to BikeTag Ambassador` , { email : ambassador . email } , 'info' )
795795 emailSent = await sendEmail (
796796 ambassador . email ,
797797 emailSubject ,
@@ -808,7 +808,7 @@ export const sendEmailsToAmbassadors = async (
808808 if ( sendToAdmin ) {
809809 const biketagAdminEmail = process . env . ADMIN_EMAIL ?? ''
810810 if ( biketagAdminEmail ?. length ) {
811- console . log ( `sending ${ emailName } email to BikeTag Administrator: $ {biketagAdminEmail } ` )
811+ log ( `sending ${ emailName } email to BikeTag Administrator:` , { biketagAdminEmail} , 'info' )
812812 emailSent = await sendEmail (
813813 biketagAdminEmail ,
814814 emailSubject ,
@@ -1094,7 +1094,7 @@ export const handleAuth0ProfileRequest = async (req: Request, profile: any): Pro
10941094 const biketagAdminOpts = getBikeTagClientOpts ( req , true )
10951095
10961096 /// Create the player profile in sanity
1097- console . log ( 'creating the player in sanity' , { data, biketagAdminOpts } )
1097+ log ( 'creating the player in sanity' , { data, biketagAdminOpts } )
10981098 const updatedPlayerResponse = await createBikeTagPlayerProfile (
10991099 data ,
11001100 biketagAdminOpts . game ,
@@ -1151,7 +1151,7 @@ export const handleAuth0ProfileRequest = async (req: Request, profile: any): Pro
11511151 }
11521152 } else {
11531153 /// Invalid data
1154- console . log ( ErrorMessage . InvalidRequestData , data , profileType )
1154+ log ( ErrorMessage . InvalidRequestData , { data, profileType } , 'error' )
11551155 body = ErrorMessage . InvalidRequestData
11561156 statusCode = HttpStatusCode . BadRequest
11571157 }
@@ -1180,7 +1180,7 @@ export const handleAuth0ProfileRequest = async (req: Request, profile: any): Pro
11801180 if ( typeof response . data === 'string' ) {
11811181 body = response . data
11821182 } else if ( Array . isArray ( response . data ) ) {
1183- if ( response . data ?. length ) console . log ( 'well how did this happen?' )
1183+ if ( response . data ?. length ) log ( 'well how did this happen?' , { 'response.data' : response . data } , 'warn ')
11841184 body = ''
11851185 } else {
11861186 const profileDataResponse = profile . isBikeTagAmbassador
@@ -1302,7 +1302,7 @@ const uploadImageToBlueSkyFromURL = async (agent: AtpAgent, url: string) => {
13021302
13031303 const uploadResponse = await agent . uploadBlob ( img )
13041304 if ( ! uploadResponse . success ) {
1305- console . log ( ErrorMessage . ImageUploadFailed , { uploadResponse } )
1305+ log ( ErrorMessage . ImageUploadFailed , { uploadResponse } , 'error' )
13061306 throw new Error ( ErrorMessage . ImageUploadFailed )
13071307 }
13081308 return uploadResponse . data . blob
@@ -1330,7 +1330,7 @@ export const sendBikeTagPostNotificationToBlueSky = async (
13301330 const bskyPass = process . env . BSKY_PASS
13311331 const bskyServer = process . env . BSKY_SERVER ?? 'https://bsky.social'
13321332
1333- console . log ( 'sending bluesky on behalf of ' + bskyUser )
1333+ log ( 'sending bluesky on behalf of ' + bskyUser , { winningTagnumber , bskyUser } )
13341334
13351335 const agent = new AtpAgent ( {
13361336 service : bskyServer ,
@@ -1377,7 +1377,7 @@ export const sendBikeTagPostNotificationToBlueSky = async (
13771377 return `bluesky::${ postCreated . cid } `
13781378 }
13791379 } catch ( e : any ) {
1380- console . log ( { blueskyError : e } )
1380+ log ( 'error sending bluesky notification' , { blueskyError : e } , 'error' )
13811381 }
13821382
13831383 return `bluesky::failed`
@@ -1406,13 +1406,11 @@ export const sendBikeTagPostNotificationToWebhook = (
14061406 const mysteryImageUrl = getImageSized ( imageSource , winningTag . mysteryImageUrl , 'l' )
14071407 const foundImageUrl = getImageSized ( imageSource , currentTag . foundImageUrl , 'l' )
14081408
1409- if ( process . env . DEBUG_A === 'true' ) {
1410- console . log ( 'sending notification webhook timestamp' , {
1411- timestamp,
1412- foundTime : currentTag . foundTime ,
1413- tz : game . region . tz ,
1414- } )
1415- }
1409+ log ( 'sending notification webhook timestamp' , {
1410+ timestamp,
1411+ foundTime : currentTag . foundTime ,
1412+ tz : game . region . tz ,
1413+ } )
14161414
14171415 let data = { }
14181416 switch ( type ) {
@@ -1776,7 +1774,7 @@ const getAuthManagementToken = async () => {
17761774 // client_secret: process.env.A_M_CS,
17771775 // audience: process.env.A_AUDIENCE,
17781776 // })
1779- console . log ( ErrorMessage . getAuthManagementToken , e . message )
1777+ log ( ErrorMessage . getAuthManagementToken , e . message , 'error' )
17801778 }
17811779}
17821780
0 commit comments