diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php index d958e1e4..5e03f624 100644 --- a/core/imageboard.pack.php +++ b/core/imageboard.pack.php @@ -243,7 +243,7 @@ class Image { global $database; if($owner->id != $this->owner_id) { $database->execute("UPDATE images SET owner_id=:owner_id WHERE id=:id", array("owner_id"=>$owner->id, "id"=>$this->id)); - log_info("core_image", "Owner for Image #{$this->id} set to {$owner->name}"); + log_info("core_image", "Owner for Image #{$this->id} set to {$owner->name}", false, array("image_id" => $this->id)); } } @@ -417,7 +417,7 @@ class Image { if(empty($new_source)) $new_source = null; if($new_source != $old_source) { $database->execute("UPDATE images SET source=:source WHERE id=:id", array("source"=>$new_source, "id"=>$this->id)); - log_info("core_image", "Source for Image #{$this->id} set to: $new_source (was $old_source)"); + log_info("core_image", "Source for Image #{$this->id} set to: $new_source (was $old_source)", false, array("image_id" => $this->id)); } } @@ -437,7 +437,7 @@ class Image { $sln = str_replace('"', "", $sln); if(bool_escape($sln) !== $this->locked) { $database->execute("UPDATE images SET locked=:yn WHERE id=:id", array("yn"=>$sln, "id"=>$this->id)); - log_info("core_image", "Setting Image #{$this->id} lock to: $ln"); + log_info("core_image", "Setting Image #{$this->id} lock to: $ln", false, array("image_id" => $this->id)); } } @@ -502,7 +502,7 @@ class Image { array("tag"=>$tag)); } - log_info("core_image", "Tags for Image #{$this->id} set to: ".implode(" ", $tags)); + log_info("core_image", "Tags for Image #{$this->id} set to: ".implode(" ", $tags), false, array("image_id" => $this->id)); $database->cache->delete("image-{$this->id}-tags"); } } @@ -514,7 +514,7 @@ class Image { global $database; $this->delete_tags_from_image(); $database->execute("DELETE FROM images WHERE id=:id", array("id"=>$this->id)); - log_info("core_image", 'Deleted Image #'.$this->id.' ('.$this->hash.')'); + log_info("core_image", 'Deleted Image #'.$this->id.' ('.$this->hash.')', false, array("image_id" => $this->id)); unlink($this->get_image_filename()); unlink($this->get_thumb_filename()); @@ -525,7 +525,7 @@ class Image { * It DOES NOT remove anything from the database. */ public function remove_image_only() { - log_info("core_image", 'Removed Image File ('.$this->hash.')'); + log_info("core_image", 'Removed Image File ('.$this->hash.')', false, array("image_id" => $this->id)); @unlink($this->get_image_filename()); @unlink($this->get_thumb_filename()); } diff --git a/ext/comment/main.php b/ext/comment/main.php index 7d16f70a..3fc24124 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -546,7 +546,7 @@ class CommentList extends Extension { $snippet = substr($comment, 0, 100); $snippet = str_replace("\n", " ", $snippet); $snippet = str_replace("\r", " ", $snippet); - log_info("comment", "Comment #$cid added to Image #$image_id: $snippet"); + log_info("comment", "Comment #$cid added to Image #$image_id: $snippet", false, array("image_id"=>$image_id, "comment_id"=>$cid)); } } // }}} diff --git a/ext/index/main.php b/ext/index/main.php index 39493921..839cb7a8 100644 --- a/ext/index/main.php +++ b/ext/index/main.php @@ -163,6 +163,7 @@ class Index extends Extension { $page_number = $event->get_page_number(); $page_size = $event->get_page_size(); try { + #log_debug("index", "Search for ".implode(" ", $search_terms), false, array("terms"=>$search_terms)); $total_pages = Image::count_pages($search_terms); if(SPEED_HAX && count($search_terms) == 0 && ($page_number < 10)) { // extra caching for the first few post/list pages $images = $database->cache->get("post-list-$page_number"); diff --git a/ext/numeric_score/main.php b/ext/numeric_score/main.php index 0c1522d4..ed7597ab 100644 --- a/ext/numeric_score/main.php +++ b/ext/numeric_score/main.php @@ -174,7 +174,7 @@ class NumericScore extends Extension { public function onNumericScoreSet(NumericScoreSetEvent $event) { global $user; - log_debug("numeric_score", "Rated Image #{$event->image_id} as {$event->score}", true); + log_debug("numeric_score", "Rated Image #{$event->image_id} as {$event->score}", true, array("image_id"=>$event->image_id)); $this->add_vote($event->image_id, $user->id, $event->score); } diff --git a/ext/report_image/main.php b/ext/report_image/main.php index 24f6b893..16980169 100644 --- a/ext/report_image/main.php +++ b/ext/report_image/main.php @@ -74,7 +74,7 @@ class ReportImage extends Extension { public function onAddReportedImage(AddReportedImageEvent $event) { global $database; - log_info("report_image", "Adding report of Image #{$event->image_id} with reason '{$event->reason}'"); + log_info("report_image", "Adding report of Image #{$event->image_id} with reason '{$event->reason}'", false, array("image_id" => $event->image_id)); $database->Execute( "INSERT INTO image_reports(image_id, reporter_id, reason) VALUES (?, ?, ?)", diff --git a/ext/tag_history/main.php b/ext/tag_history/main.php index e67b7ac0..583f7afe 100644 --- a/ext/tag_history/main.php +++ b/ext/tag_history/main.php @@ -331,10 +331,10 @@ class Tag_History extends Extension { if(empty($old_tags)) { /* no old tags, so we are probably adding the image for the first time */ - log_debug("tag_history", "adding new tag history: [$new_tags]"); + log_debug("tag_history", "adding new tag history: [$new_tags]", false, array("image_id" => $image->id)); } else { - log_debug("tag_history", "adding tag history: [$old_tags] -> [$new_tags]"); + log_debug("tag_history", "adding tag history: [$old_tags] -> [$new_tags]", false, array("image_id" => $image->id)); } $allowed = $config->get_int("history_limit");