Disable messages upon loading a package

Just use suppressMessages() around your library() call: edd@max:~$ R R version 2.14.1 (2011-12-22) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-pc-linux-gnu (64-bit) […] R> suppressMessages(library(ROCR)) R> # silently loaded R> search() [1] “.GlobalEnv” “package:ROCR” # it’s really there [3] “package:gplots” “package:KernSmooth” [5] “package:grid” “package:caTools” [7] “package:bitops” “package:gdata” [9] “package:gtools” “package:stats” … Read more

How do I disable log messages from the Requests library?

I found out how to configure requests‘s logging level, it’s done via the standard logging module. I decided to configure it to not log messages unless they are at least warnings: import logging logging.getLogger(“requests”).setLevel(logging.WARNING) If you wish to apply this setting for the urllib3 library (typically used by requests) too, add the following: logging.getLogger(“urllib3”).setLevel(logging.WARNING)