inst/App/util/logger.R

SHOW_DEBUG_LOG=FALSE

log.fin<-function(x){ 
  if(SHOW_DEBUG_LOG){
    cat(
      '>>>',
      '------',
      deparse(substitute(x)),
      '------\n',
      sep=""
    )
  }
}
log.fout<-function(x){ 
  if(SHOW_DEBUG_LOG){
    cat(
      '<<<',
      '------',
      deparse(substitute(x)),
      '------\n',
      sep=""
    )
  }
}
log.val<-function(x){ 
  if(SHOW_DEBUG_LOG){
    tryCatch(
      cat(
        '   ',
        deparse(substitute(x)),
        '=',
        format(x),
        '\n',
        sep=""
      ),
      error=function(e){
        print(e)
      }
      
    )
  }
}

log.counter<-function(x=0){
  x<-x+1
  cat(paste0('counter-',x),'\n')
  x
}
mslegrand/pointR documentation built on July 4, 2022, 9:57 p.m.