-
Notifications
You must be signed in to change notification settings - Fork 17
Update client logging #195
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
Conversation
- Exposes control of logging with `data-ea-verbosity` - Makes some debug/info messages not visible by default - Downgrades "already loaded" from error->warning - Increases "No ad placements found" (missing div) from debug->warning
@@ -921,7 +956,7 @@ export function load_placements(force_load = false) { | |||
let elements = Array.prototype.slice.call(node_list); | |||
|
|||
if (elements.length === 0) { | |||
console.debug("No ad placements found."); | |||
logger.warn("No ad placements found."); |
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.
Should we provide more context here? I feel like as a user this message is not super helpful..
logger.warn("No ad placements found."); | |
logger.warn("No ad placements found. Check your publisher account is correct and has ads enabled."); |
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'm ok with this but there are a few reasons why this can happen. There can be no ads available for their geo/targeting or settings (they've disabled house ads while paid ads aren't enabled).
Edit: This message is when there's no ad div to place the ad. This should probably be a message like "No ad placements found. https://ethical-ad-client.readthedocs.io/en/latest/#usage"
@@ -1071,17 +1122,17 @@ if (check_dependencies()) { | |||
if (err instanceof Error) { | |||
if (err instanceof EthicalAdsWarning) { | |||
// Report these at a lower log level | |||
console.debug(err.message); | |||
logger.warn(err.message); |
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 think we want these at warning. The main things that are displayed from this message are when there are no ads to show and when the ad request is blocked (ad blocker) or invalid (wrong publisher account). I think we want these to be visible at default verbosity.
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.
Yea, makes sense 👍
data-ea-verbosity