Skip to content

Commit

Permalink
uses debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansampson committed Jan 15, 2025
1 parent 01c9de6 commit 6d39b1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions browser/brave_screenshots/screenshots_tab_feature.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ void DisplayScreenshotClippedNotification(base::WeakPtr<Browser> browser) {
namespace brave_screenshots {

BraveScreenshotsTabFeature::BraveScreenshotsTabFeature() {
VLOG(1) << "BraveScreenshotsTabFeature created";
DVLOG(1) << "BraveScreenshotsTabFeature created";
}

BraveScreenshotsTabFeature::~BraveScreenshotsTabFeature() {
VLOG(1) << "BraveScreenshotsTabFeature destroyed";
DVLOG(1) << "BraveScreenshotsTabFeature destroyed";
if (strategy_) {
strategy_.reset();
}
}

void BraveScreenshotsTabFeature::StartScreenshot(Browser* browser,
ScreenshotType type) {
VLOG(1) << "Starting screenshot capture";
DVLOG(1) << "Starting screenshot capture";
CHECK(browser);

browser_ = browser->AsWeakPtr();
Expand Down Expand Up @@ -71,15 +71,15 @@ std::unique_ptr<BraveScreenshotStrategy>
BraveScreenshotsTabFeature::CreateStrategy(ScreenshotType type) {
switch (type) {
case ScreenshotType::kFullPage:
VLOG(3) << "Creating FullPageStrategy";
DVLOG(3) << "Creating FullPageStrategy";
return std::make_unique<FullPageStrategy>();
case ScreenshotType::kSelection:
// Based on image_editor::ScreenshotFlow, which requires a WebContents
VLOG(3) << "Creating SelectionStrategy";
DVLOG(3) << "Creating SelectionStrategy";
return std::make_unique<SelectionStrategy>(web_contents_.get());
case ScreenshotType::kViewport:
// Based on image_editor::ScreenshotFlow, which requires a WebContents
VLOG(3) << "Creating ViewportStrategy";
DVLOG(3) << "Creating ViewportStrategy";
return std::make_unique<ViewportStrategy>(web_contents_.get());
default:
NOTREACHED();
Expand All @@ -91,7 +91,7 @@ void BraveScreenshotsTabFeature::OnCaptureComplete(
DVLOG(2) << __func__;

if (result.image.IsEmpty()) {
LOG(ERROR) << "Screenshot capture failed";
DVLOG(2) << "Screenshot capture failed";
return;
}

Expand Down
6 changes: 3 additions & 3 deletions browser/brave_screenshots/strategies/fullpage_strategy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,20 @@ void FullPageStrategy::RequestPageLayoutMetrics() {
void FullPageStrategy::OnLayoutMetricsReceived(int width, int height) {
// Maybe clip dimensions
if (width > kMaxDimensions) {
LOG(WARNING) << "Clipping screenshot width to " << kMaxDimensions;
DVLOG(3) << "Clipping screenshot width to " << kMaxDimensions;
width = kMaxDimensions;
screenshot_was_clipped_ = true;
}

if (height > kMaxDimensions) {
LOG(WARNING) << "Clipping screenshot height to " << kMaxDimensions;
DVLOG(3) << "Clipping screenshot height to " << kMaxDimensions;
height = kMaxDimensions;
screenshot_was_clipped_ = true;
}

// Check for invalid dimensions
if (width <= 0 || height <= 0) {
LOG(ERROR) << "Invalid dimensions from Page.getLayoutMetrics";
DVLOG(2) << "Invalid dimensions from Page.getLayoutMetrics";
RunCallback({});
return;
}
Expand Down

0 comments on commit 6d39b1e

Please sign in to comment.