Comments (6)
A short update: it actually works with only DEBUGME=inspecter
when setting it as an env var outside of R. Does this clarify anything?
DEBUGME=inspecter R -q -e 'library("inspecter"); inspecter::start()'
> library("inspecter"); inspecter::start()
onLoad: libname: /home/daniel/R/x86_64-pc-linux-gnu-library/3.4 environment: base
<environment: namespace:base>
Attaching package: ‘inspecter’
The following object is masked from ‘package:stats’:
start
start: pkg: R_GlobalEnv
<environment: R_GlobalEnv>
inspecter starting...
inspecter initialize plumber with route definitions from /home/daniel/R/x86_64-pc-linux-gnu-library/3.4/inspecter/api.R +29ms
init: pkg: R_GlobalEnv
<environment: R_GlobalEnv>
inspecter run plumber +201ms
Starting server to listen on port 8091
from debugme.
Debugging is turned on/off when you load your package. So setting the env var after loading it, will not change anything.
from debugme.
Sorry, I don't know what changed, I failed to re-test the combinations of values for DEBUGME
:
> Sys.setenv(DEBUGME = "inspecter")
> library(inspecter)
onLoad: libname: /home/daniel/R/x86_64-pc-linux-gnu-library/3.4 environment: base
<environment: namespace:base>
Attaching package: ‘inspecter’
The following object is masked from ‘package:stats’:
start
> inspecter::start()
start: pkg: R_GlobalEnv
<environment: R_GlobalEnv>
inspecter starting...
inspecter initialize plumber with route definitions from /home/daniel/R/x86_64-pc-linux-gnu-library/3.4/inspecter/api.R +35ms
inspecter run plumber +275ms
Starting server to listen on port 8091
Running the swagger UI at http://127.0.0.1:8091/__swagger__/
from debugme.
Apologies for the back and forth. The problem remains for logs from the file inst/api.R
.
@trestletech can you shed light on how plumber::plumb(file = "inst/api.R")
loads the file, i.e. what environment it should be in?
from debugme.
The runtime and environments for plumber are documented here: https://www.rplumber.io/docs/runtime.html
from debugme.
@trestletech Thanks, that helps. So I could define my routers programmatically instead of using annotations and then set my own environment. This line also explains why logging works when I enable it for the the environment R_GlobalEnv,base
. I tried to fix this by creating a new environment with my package environment as parent and initiating my router with it, but that did not work.
Eventually I switched from annotations to defining my endpoints with pr$handle()
.
Hope this helps other people logging plumber with debugme.
from debugme.
Related Issues (20)
- Handle repetitive messages better
- Make it easier to go into "debug mode" HOT 12
- debug levels? HOT 4
- Add release notes 👾
- Enable time stamp mode manually for terminal output
- Suppress time stamp diff for a specific call
- WISH: Near-zero overhead assertions HOT 2
- Use comments instead of strings HOT 4
- Allow tags
- Plans for V2
- Implement using conditions HOT 4
- debugme, package support and datasets HOT 2
- FR: Show file and line with each debug message HOT 1
- Do debug levels still work? HOT 3
- Document integration with plogr HOT 1
- debugme modifies data.frame to list inside R6 class field
- still calculating unused debugs? HOT 1
- debugme sets .Random.seed on load HOT 13
- Move `master` branch to `main` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from debugme.