@@ -117,6 +117,11 @@ function checkForUpdate() {
117
117
} ) ;
118
118
}
119
119
120
+ /* Logs messages to console with the [CodePush] prefix */
121
+ function log ( message ) {
122
+ console . log ( `[CodePush] ${ message } ` )
123
+ }
124
+
120
125
/**
121
126
* The sync method provides a simple, one-line experience for
122
127
* incorporating the check, download and application of an update.
@@ -142,27 +147,27 @@ function sync(options = {}, syncStatusChangeCallback, downloadProgressCallback)
142
147
: function ( syncStatus ) {
143
148
switch ( syncStatus ) {
144
149
case CodePush . SyncStatus . CHECKING_FOR_UPDATE :
145
- console . log ( "[CodePush] Checking for update." ) ;
150
+ log ( "Checking for update." ) ;
146
151
break ;
147
152
case CodePush . SyncStatus . DOWNLOADING_PACKAGE :
148
- console . log ( "[CodePush] Downloading package." ) ;
153
+ log ( "Downloading package." ) ;
149
154
break ;
150
155
case CodePush . SyncStatus . AWAITING_USER_ACTION :
151
- console . log ( "[CodePush] Awaiting user action." ) ;
156
+ log ( "Awaiting user action." ) ;
152
157
break ;
153
158
case CodePush . SyncStatus . INSTALLING_UPDATE :
154
- console . log ( "[CodePush] Installing update." ) ;
159
+ log ( "Installing update." ) ;
155
160
break ;
156
161
case CodePush . SyncStatus . IDLE :
157
- console . log ( "[CodePush] Sync is idle." ) ;
162
+ log ( "Sync is idle." ) ;
158
163
break ;
159
164
}
160
165
} ;
161
166
162
167
downloadProgressCallback = typeof downloadProgressCallback == "function"
163
168
? downloadProgressCallback
164
169
: function ( downloadProgress ) {
165
- console . log ( `[CodePush] Expecting ${ downloadProgress . totalBytes } bytes, received ${ downloadProgress . receivedBytes } bytes.` ) ;
170
+ log ( `Expecting ${ downloadProgress . totalBytes } bytes, received ${ downloadProgress . receivedBytes } bytes.` ) ;
166
171
} ;
167
172
168
173
return new Promise ( ( resolve , reject ) => {
0 commit comments