@@ -179,6 +179,7 @@ module Exceptionless {
179179 }
180180
181181 var key = this . queuePath ( ) + '-' + new Date ( ) . toJSON ( ) + '-' + Math . floor ( Math . random ( ) * 9007199254740992 ) ;
182+ this . _config . log . info ( 'Enqueuing event: ' + key ) ;
182183 return this . _config . storage . save ( key , event ) ;
183184 }
184185
@@ -197,16 +198,17 @@ module Exceptionless {
197198
198199 try {
199200 var events = this . _config . storage . get ( this . queuePath ( ) , this . _config . submissionBatchSize ) ;
200- if ( events . length == 0 ) {
201+ if ( ! events || events . length == 0 ) {
201202 this . _config . log . info ( 'There are currently no queued events to process.' ) ;
202203 return ;
203204 }
204205
206+ this . _config . log . info ( 'Sending ' + events . length + ' events to ' + this . _config . serverUrl + '.' ) ;
205207 this . _config . submissionClient . submit ( events , this . _config )
206208 . then (
207209 ( response :SubmissionResponse ) => {
208210 if ( response . success ) {
209- this . _config . log . info ( 'Sent ' + events . length + ' events to " ' + this . _config . serverUrl + '" .' ) ;
211+ this . _config . log . info ( 'Sent ' + events . length + ' events to ' + this . _config . serverUrl + '.' ) ;
210212 } else if ( response . serviceUnavailable ) {
211213 // You are currently over your rate limit or the servers are under stress.
212214 this . _config . log . error ( 'Server returned service unavailable.' ) ;
@@ -257,8 +259,6 @@ module Exceptionless {
257259 }
258260
259261 private onProcessQueue ( ) {
260- return false ;
261-
262262 if ( ! this . isQueueProcessingSuspended ( ) && ! this . _processingQueue ) {
263263 this . process ( ) ;
264264 }
@@ -271,7 +271,6 @@ module Exceptionless {
271271
272272 this . _config . log . info ( 'Suspending processing for ' + durationInMinutes + 'minutes.' ) ;
273273 this . _suspendProcessingUntil = new Date ( new Date ( ) . getTime ( ) + ( durationInMinutes * 60000 ) ) ;
274- //_queueTimer.Change(duration.Value, _processQueueInterval);
275274
276275 if ( discardFutureQueuedItems ) {
277276 this . _discardQueuedItemsUntil = new Date ( new Date ( ) . getTime ( ) + ( durationInMinutes * 60000 ) ) ;
@@ -288,7 +287,9 @@ module Exceptionless {
288287 }
289288
290289 private requeueEvents ( events :IEvent [ ] ) {
291- for ( var event in events || [ ] ) {
290+ this . _config . log . info ( 'Requeuing ' + events . length + ' events.' ) ;
291+
292+ for ( var event in events ) {
292293 this . enqueue ( event ) ;
293294 }
294295 }
@@ -560,12 +561,18 @@ module Exceptionless {
560561 }
561562
562563 public setType ( type :string ) : EventBuilder {
563- this . target . type = type ;
564+ if ( type && type . length > 0 ) {
565+ this . target . type = type ;
566+ }
567+
564568 return this ;
565569 }
566570
567571 public setSource ( source :string ) : EventBuilder {
568- this . target . source = source ;
572+ if ( source && source . length > 0 ) {
573+ this . target . source = source ;
574+ }
575+
569576 return this ;
570577 }
571578
@@ -588,7 +595,10 @@ module Exceptionless {
588595 }
589596
590597 public setMessage ( message :string ) : EventBuilder {
591- this . target . message = message ;
598+ if ( message && message . length > 0 ) {
599+ this . target . message = message ;
600+ }
601+
592602 return this ;
593603 }
594604
@@ -603,12 +613,15 @@ module Exceptionless {
603613 }
604614
605615 public setValue ( value :number ) : EventBuilder {
606- this . target . value = value ;
616+ if ( value ) {
617+ this . target . value = value ;
618+ }
619+
607620 return this ;
608621 }
609622
610623 public addTags ( ...tags :string [ ] ) : EventBuilder {
611- if ( tags == null || tags . length === 0 ) {
624+ if ( ! tags || tags . length === 0 ) {
612625 return this ;
613626 }
614627
0 commit comments