Comments (5)
Sure! In PR #13 I have:
debug!("execve(\"{:?}\", {:?})", path_name, args);
trace!("envp={:?}", envp);
That is, when running on debug
we print the path and args to execve
, but only when running on trace
do we print the environment variables (which might still be too verbose, even for trace).
In general I treat info
as the default logging mode, which prints useful information for what is happening but not too verbose. debug
is even more information but still relates to logical events hapenning, trace
I like trace
being verbose enough to understand what function is currently executing and sometimes even which code branch was taken. Lmk if that makes sense!
from processcache.
The standard verbosity levels for Rust are as follow. Here is my recommended convention for logging output:
- Error: We usually panic on error as there isn't much need for us to recover from fatal errors so we probably won't use error.
- Warn: This is similar to error but it might be useful to
warn
in some situations. We should usewarn
for reporting issues to the user. - Info: Info should be reserved for always relevant information. Some examples include: encountered an
exec
, new process spawned, ptrace event intercepted. Specific system call being handled. - Debug: This is for low priority, but sometimes nice to have extra information.
-Trace: Trace is extremely verbose and often tracks all function calls and events one might want to know about when debugging an issue.
It may seem that trace
is like drinking from a fire hose, thankfully Rust and the Tracing crate allows us to filter events several ways, making it far easier to track only events we care about. This also needs to be considered when adding logging for the project. More on this to come...
from processcache.
Thank you for listing these, I actually don't think I really knew about those! But I will definitely keep these in mind. I think the one I don't see the difference between is debug and trace. I think I usually them interchangeably, and I actually don't think I've really used trace. Could you give me an example of when to use one over the other?
from processcache.
Yes that totally makes sense. Thank you for doing this!
from processcache.
Done by @gatoWololo in #13
from processcache.
Related Issues (20)
- Panic when caching "top level" exec HOT 1
- Eventually, directories have to be handled...
- Ensure all system calls called by each bioinformatics workflow are handled HOT 3
- Threads as part of parent execution
- Handle chdir
- Handle statfs
- Handle special close(1) [tar]
- Handle pipe, socket, connect [tar]
- Treat tar as one big execution
- Handle mkdir
- Record initial umask as a precondition HOT 3
- Fix get_full_path(), handle newfstatat
- Handle RW case for open HOT 1
- Separate file events and dir events
- Handle utimensat
- Handle uname
- record signal mask
- Implement no stdout flag
- Replace OFlag in FileEvent::Create with custom enum
- Update tests
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 processcache.