-
Notifications
You must be signed in to change notification settings - Fork 14
Project Type Update & Logging Interface #3
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
Open
furkanvarol
wants to merge
9
commits into
AltBeacon:master
Choose a base branch
from
furkanvarol:develop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f3828ea
Logger interfaces has been implemented also Diagnostics loggers have …
furkanvarol c0423c2
missing part of FromScanData method
furkanvarol 850f5b0
Beacon and BeaconParser has been adapter to LogManager (TODOs has bee…
furkanvarol 66c58fa
fixed on LogManagers predefined logger factory var type also a defaul…
furkanvarol 93d3b9c
Portable Class Library has been changed with Class Library (Library P…
furkanvarol 17c0f0d
UnitTests for logging package
furkanvarol 1ec58d2
bug fix on WarningDiagnosticsLoggerFactory
furkanvarol 071e902
.Net version has been dropped from 4.5 to 4.0
furkanvarol 010943f
VerboseLoggingEnabled has been renamed to DebugLoggingEnabled
furkanvarol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the debug logs inside the parser probably need to be wrapped in an if statement that checks to see if debug is enabled before constructing the string. It is really important to do that here because this code will run hundreds of times per second when lots of bluetooth devices are around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, then the flag name "VerboseLoggingEnabled" must be changed to "BeaconParserLoggingEnabled", right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't think that is necessary. If you have VerboseLoggingEnabled set to false, lines like
Logger.Debug("cannot parse term " + term);
will do nothing anyway. All you are accomplishing by wrapping these in if statements like:is making it so the string object construction and concatenation does not take place unnecessarily, which saves processing time. Even if you don't do this everywhere, doing it inside beacon parsing is important because it is gets executed in a tight loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, I can write add
LogManager.VerboseLoggingEnabled
condition to every logger so that they wont log anything like it supposed to do and also if I use logger with params likeLogger.Debug("cannot parse term {0}", term);
, log string won't even get built (but of course in this case it will change nothing since there is only one param).Also, this is a debug log not a verbose that is why I asked to change name of the flag since
VerboseLoggingEnabled
kind of misleading for disabling debug logs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flag could change to DebugLoggingEnabled, yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I will change the flag name. So what about the other thing that I told you above ? Does it sounds good or not even necessary ?
Also, what about the comments below ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have wrapped this log with condition and renamed VerboseLoggingEnabled to DebugLoggingEnabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you have to "add LogManager.VerboseLoggingEnabled condition to every logger". It is only really necessary inside the parser where performance counts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I have only wrapped one log which is proposed by you above.