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

custom levels #17

Open
mfrasca opened this issue Oct 13, 2014 · 0 comments
Open

custom levels #17

mfrasca opened this issue Oct 13, 2014 · 0 comments

Comments

@mfrasca
Copy link
Contributor

mfrasca commented Oct 13, 2014

from an email (Paul Roebuck, 2014-10-03)
can I add a custom level?

Desired processing follows...

R> addLevelName <- function(value, levelname) {
    stopifnot(is.numeric(value) && length(value) == 1)
    stopifnot(is.character(levelname) && length(levelname) == 1 && nzchar(levelname))
    names(value) <- levelname
    loglevels <<- sort(c(loglevels, as.integer(value)))
}

R> addLevelName(9, 'NUMBER9')
R> loglevels
  NOTSET   FINEST    FINER     FINE  NUMBER9    DEBUG     INFO
  WARNING     WARN    ERROR CRITICAL    FATAL 
  0        1        4        7        9       10       20
  30       30       40       50       50 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant