@@ -237,7 +237,7 @@ RLog <- R6Class(
237
237
private $ appendEntry(domain , list (
238
238
action = " define" ,
239
239
reactId = reactId ,
240
- label = label ,
240
+ label = msg $ shortenString( label ) ,
241
241
type = type ,
242
242
value = valueStr
243
243
))
@@ -294,7 +294,7 @@ RLog <- R6Class(
294
294
private $ appendEntry(domain , list (
295
295
action = " createContext" ,
296
296
ctxId = ctxId ,
297
- label = label ,
297
+ label = msg $ shortenString( label ) ,
298
298
type = type ,
299
299
prevCtxId = prevCtxId ,
300
300
srcref = as.vector(attr(label , " srcref" )), srcfile = attr(label , " srcfile" )
@@ -511,12 +511,16 @@ MessageLogger = R6Class(
511
511
if (identical(force , FALSE ) && self $ isNotLogging()) return (NULL )
512
512
self $ reactCache [[reactObj $ reactId ]] <- reactObj
513
513
},
514
- shortenString = function (txt , n = 100 ) {
514
+ shortenString = function (txt , n = 250 ) {
515
+ if (is.null(txt ) || isTRUE(is.na(txt ))) {
516
+ return (" " )
517
+ }
515
518
if (nchar(txt ) > n ) {
516
- paste0(substr( txt , 1 , n - 3 ), " ... " )
517
- } else {
518
- txt
519
+ return (
520
+ paste0(substr( txt , 1 , n - 3 ), " ... " )
521
+ )
519
522
}
523
+ return (txt )
520
524
},
521
525
singleLine = function (txt ) {
522
526
gsub(" [^\\ ]\\ n" , " \\\\ n" , txt )
0 commit comments