Skip to content

Improve logging in getNextRandomBlockSize() #6

Description

@fpahlke

Add comprehensive logging information at each block size randomization step, see TODO below:

getNextRandomBlockSize = function() {
    if (is.null(blockSizes) || length(blockSizes) == 0) {
        stop("No block sizes are defined")
    }

    if (length(blockSizes) == 1) {
        return(blockSizes[[1]])
    }

    if (fixedBlockDesignEnabled) {
        randomIndex <- fixedBlockIndex
    } else {
        if (is.null(blockSizeRandomizer)) {
            stop("'blockSizeRandomizer' is not initialized")
        }
        
        randomIndex <- blockSizeRandomizer$nextInt(length(blockSizes))
        message("Get next random block size (index = ", randomIndex, ")")
    }

    blockSize <- blockSizes[[randomIndex]]

    # TODO logging
    # Map<String, Object> rndLoggerValues = new HashMap<String, Object>()
    # rndLoggerValues.put("blockSize", "new random block size: " + blockSize + " (random index: " + randomIndex + ")")
    # logger.info("Random configuration set: " + rndLoggerValues)

    return(blockSize)
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions