Comments (6)
Here is my thoughts for how to do this. There should be a bunch of logging functions representing various levels of output (trace, debug, warn, info, error). And each of these functions should output based on the current log level (set by default to warn perhaps, but overridable by command line or FDT or environment variable.) This way we don't have to struggle too much for when to put debug output in the code, just choose the appropriate level
from ebbrt.
We went through several designs on this topic. Questions about how to keep the checks flexible and
yet potentially eliminate them all together to avoid overheads. (eg. no memory or coherency traffic).
I am happy to chat about the approaches we have looked at in the past.
On Feb 25, 2016, at 11:15 AM, Dan Schatzberg [email protected] wrote:
Here is my thoughts for how to do this. There should be a bunch of logging functions representing various levels of output (trace, debug, warn, info, error). And each of these functions should output based on the current log level (set by default to warn perhaps, but overridable by command line or FDT or environment variable.) This way we don't have to struggle too much for when to put debug output in the code, just choose the appropriate level
—
Reply to this email directly or view it on GitHub #96 (comment).
from ebbrt.
@jappavoo
If possible, add thoughts to this post so we have it all documented.
Another feature I would desire is the ability to enable/disable output per file, perhaps having the functions pass the value of the predefined FILE macro.
from ebbrt.
logging functions representing various levels of output (trace, debug, warn, info, error)
Yes, I agree. We'd probably want both a "LogManager" Ebb, or a set of low-level kprintf-like functions (kprinf-debug(), kprintf-error(), kprintf-all()).
ability to enable/disable output per file, perhaps having the functions pass the value of the predefined FILE macro
I'm not sure I follow...a file-specific macro? E.g., __EBBRT_EVENTMANAGER__QUIET_ALL__
?
We went through several designs on this topic.
Here's a glance into one way we had previously hacked together a 'quiet' build:
546c1f9
from ebbrt.
@jmcadden
I'm not sure I follow...a file-specific macro? E.g., EBBRT_EVENTMANAGER__QUIET_ALL ?
I'm motivated by the way Rust's env_logger
works: https://rust-lang-nursery.github.io/log/env_logger/
GCC defines __FILE__
to be the current file name. So if we had the (for example) LOG()
macro pass the file name to the logging object. Then the logging object could decide to log (or not) based on some file-specific setting. For example, suppose we could configure the log output with some variable like so: EBBRT_LOG="warn,EventManager=debug"
then all log output with warn
or higher (e.g. error
) will be output. However, any output in the EventManager
with debug
or higher will be output.
from ebbrt.
For the time being: EbbRT baremetal has a compilation flag that will mute kprintf() output, along with a force_kprintf() that will print when others are muted.
from ebbrt.
Related Issues (20)
- EbbRT front-end as shared object libraries HOT 2
- Need travis
- Freeing of large memory regions
- (NodeAllocator): named docker networks and containers
- (NodeAllocator): Assigns host a 256.x.x.x address HOT 1
- Permit user to select backend image at runtime
- (NodeAllocator): throw exception when network-create fails
- why c++
- NodeAllocator bug in new defaults logic
- How do we run a simple node application with EbbRT HOT 1
- Building helloworld.elf HOT 1
- Futures do not flatten HOT 1
- Can't have Future<Reference>
- Make callbacks asynchronous (or use Futures) HOT 1
- No assert for insufficient system memory
- Messenger code does not utilize the CloneView constructors
- test
- Dependency tracking of header-only changes HOT 4
- System design review 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 ebbrt.