Skip to content

Messages being truncated #33

@mike-lawrence

Description

@mike-lawrence

I'm looking at using loggr in a scenario where I'm creating new processes using system2(command = "Rscript" , args = c('--vanilla','my_script.R'), stdout = stdout_file, stderr = stderr_file, wait = FALSE), where I use loggr inside the script my_script. However, when I compare the log file to the stderr file, the loggr file seems to have truncated the messages. For example, a stderr file might have the contents:

Warning messages:
1: There were 38 divergent transitions after warmup. Increasing adapt_delta above 0.8 may help. See
http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup 
2: Examine the pairs() plot to diagnose sampling problems

But the log file only has:

There were 
Examine the pairs() plot to diagnose sampling problems

All I'm doing to activate loggr in my_script.R is:

library(loggr)
my_formatter <- function(event) event$message
log_file(log_file_name,.formatter = my_formatter,subscriptions=c('message', 'warning','stop'))

Any idea what I should be doing instead to avoid truncation of those messages?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions