Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I think this fixes the truncated messages issue #34

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions R/notify_loggr.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ notify_loggr <- function(..., type = "other", muffled = FALSE)
args <- list(...)
if (inherits(args[[1L]], "condition")) {
cond <- args[[1L]]
} else if (type == "error") {
} else {
message = unlist(args)
message = paste0(message[1:(length(message)-3)],collapse='')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we be sure that length(message) > 3 here? We should use consistent syntax, <- for assignment, and spacing in argument list and around the minus.

if (type == "error") {
# Can we get the call here?
cond <- simpleError(.makeMessage(args[[1L]], domain = args[["domain"]]))
} else if (type == "warning") {
cond <- simpleError(.makeMessage(message, domain = args[["domain"]]))
} else if (type == "warning") {
# Can we get the call here?
cond <- simpleWarning(.makeMessage(args[[1L]], domain = args[["domain"]]))
} else {
cond <- simpleCondition(.makeMessage(args[[1L]], domain = args[["domain"]]))
cond <- simpleWarning(.makeMessage(message, domain = args[["domain"]]))
} else {
cond <- simpleCondition(.makeMessage(message, domain = args[["domain"]]))
}
}
le <- as_log_event(cond)

Expand Down