From b7badacd3f984cd7d1e26ce941814f1283474d85 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Mon, 20 May 2024 04:15:15 -0700 Subject: [PATCH] Standardize wording in memcache logging. --- Rocksolid_Light/rocksolid/lib/thread.inc.php | 6 +++--- Rocksolid_Light/rocksolid/newsportal.php | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Rocksolid_Light/rocksolid/lib/thread.inc.php b/Rocksolid_Light/rocksolid/lib/thread.inc.php index d9a56b3..0a2bbb2 100644 --- a/Rocksolid_Light/rocksolid/lib/thread.inc.php +++ b/Rocksolid_Light/rocksolid/lib/thread.inc.php @@ -107,7 +107,7 @@ function thread_cache_load($group) } if ($nicole && $enable_memcache_logging) { - file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " (cache miss) Wrote $key (" . strlen($add_thread) . " bytes)", FILE_APPEND); + file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " (cache write) $key (" . strlen($add_thread) . " bytes)", FILE_APPEND); } if ($too_big) { file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " $key too large (" . $thread_bytes . " bytes)", FILE_APPEND); @@ -164,10 +164,10 @@ function thread_cache_save($headers, $group) } if ($enable_memcache_logging) { if ($del) { - file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Deleted $key", FILE_APPEND); + file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " (cache delete) $key", FILE_APPEND); } if ($nicole) { - file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Wrote $key (" . $thread_bytes . " bytes)", FILE_APPEND); + file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " (cache write) $key (" . $thread_bytes . " bytes)", FILE_APPEND); } if ($too_big) { file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " $key too large (" . $thread_bytes . " bytes)", FILE_APPEND); diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index 7dade47..7c7760d 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -691,9 +691,9 @@ function groups_show($gruppen) $memcacheD->add($lar_memcache, serialize($row), $memcache_ttl); if ($enable_memcache_logging) { if ($nicole) { - file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Updated $lar_memcache", FILE_APPEND); + file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " (cache update) $lar_memcache", FILE_APPEND); } else { - file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Wrote $lar_memcache", FILE_APPEND); + file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " (cache write) $lar_memcache", FILE_APPEND); } } } @@ -1653,7 +1653,7 @@ function get_newsgroups_by_msgid($msgid, $noarray = false) if ($groups && $memcacheD) { $nicole = $memcacheD->add($key, $groups, $memcache_ttl); if ($enable_memcache_logging && $nicole) { - file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Wrote $key", FILE_APPEND); + file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " (cache write) $key", FILE_APPEND); } } } @@ -1942,7 +1942,7 @@ function np_get_db_article($article, $group, $makearray = 1, $dbh = null) if ($ok_article == 1 && $memcacheD) { $nicole = $memcacheD->add($article_key, $msg2, $memcache_ttl); if ($enable_memcache_logging && $nicole) { - file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Wrote $article_key", FILE_APPEND); + file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " (cache write) $article_key", FILE_APPEND); } } } @@ -2460,7 +2460,7 @@ function insert_article_from_array($this_article, $check_duplicates = true) $article_key = $memcache_key_prefix . '_' . 'article.db3-' . $group . ':' . $this_article['local']; $nicole = $memcacheD->add($article_key, $this_article['article'], $memcache_ttl); if ($enable_memcache_logging && $nicole) { - file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Wrote (new) $article_key", FILE_APPEND); + file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " (cache write) (new) $article_key", FILE_APPEND); } } } else { @@ -2565,7 +2565,7 @@ function get_db_data_from_msgid($msgid, $group) if ($memcacheD) { $nicole = $memcacheD->add($row_cache, $row, $memcache_ttl); if ($enable_memcache_logging && $nicole) { - file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Wrote $row_cache", FILE_APPEND); + file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " (cache write) $row_cache", FILE_APPEND); } } return $row; @@ -2644,7 +2644,7 @@ function get_data_from_msgid($msgid, $thisgroup = null) if ($memcacheD) { $nicole = $memcacheD->add($row_cache, $row, $memcache_ttl); if ($enable_memcache_logging && $nicole) { - file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Wrote $row_cache", FILE_APPEND); + file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " (cache write) $row_cache", FILE_APPEND); } } return $row;