Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a flexible logging system #3

Open
hankshz opened this issue Dec 25, 2013 · 3 comments
Open

Need a flexible logging system #3

hankshz opened this issue Dec 25, 2013 · 3 comments
Assignees

Comments

@hankshz
Copy link
Collaborator

hankshz commented Dec 25, 2013

Requirement:

  1. Need different logging level. The displayed level can be adjusted (At least in the compiling stage now, should be able to be adjusted on the run time later). And the number of levels can be configured.
  2. Need different logging output destination. It should at least support the screen printf and file record. And it should be configurable.
  3. Always have the same interface for the user.
@ghost ghost assigned freakrobot Dec 25, 2013
@freakrobot
Copy link
Owner

For the 1st version of the logging system, I will integrate it with LeapGestureManagement Class, which is on top of all classes.
The logging system will desgin in 3 different levels.
0 -- no logging
1 -- error message(ERRORs that make the system stop working)
2 -- debug(all the tracing information)
format of the loggin system is
[TIME][ FILE:LINE] [CLASS NAME:FUNCTION]LOGGING CONTENT

all logging information will be wrapper into the #if MACRO should not be compiled into the release binary

@hankshz
Copy link
Collaborator Author

hankshz commented Dec 31, 2013

Here is my idea about different levels:
0 - no logging at all. Not very necessary as long as we keep level 1 concise
1 - recording. Very critical info such as "the system is initialized". Used to quickly locate which part is finished and which is next.
2 - warning. Undesired but okay issue such as "high network delay" or "one hand is missing".
3 - error. Unexpected but known issue, such as the error reported from leap
4 - panic. Something must mess up, such as malloc fails
5 - debug. Anything you want to check, but SHOULD NOT checkin.

Therefore, ideally we do not need to differentiate debug or release. But it is okay to use macro to achieve efficiece.

@hankshz
Copy link
Collaborator Author

hankshz commented Dec 31, 2013

Another thing is that, traditionally, if we are in level 2, we should see both recording and warding. But ideally we would want to select different level to display the content only in that level, which is not efficient in performance. If it can be done, it is great. If not, probably for level 0 - 4, we do the traditional implementation. For level 5, we always display it but use a macro to make sure it is not in the release binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants