R Under development (unstable) (2024-07-28 r86931 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > message("*** debug() ...") *** debug() ... > > debug <- startup:::debug ## non-exported > is_debug_on <- startup::is_debug_on > > print(debug()) [1] FALSE > print(is_debug_on()) [1] FALSE > > print(debug(TRUE)) [1] TRUE > stopifnot(is_debug_on()) > > startup:::log("Hello") 0.000s: Hello > startup:::logf("Hello %s", "world") 0.000s: Hello world > startup:::logp(str(1:10)) 0.004s: int [1:10] 1 2 3 4 5 6 7 8 9 10 0.004s: NULL > > print(debug(FALSE)) [1] FALSE > stopifnot(!is_debug_on()) > > message("*** debug() ... DONE") *** debug() ... DONE > > rm(list = "debug") > > proc.time() user system elapsed 0.12 0.04 0.17