]> Entropealabs - cluster_kv.git/commitdiff
more logging
authorChristopher <chris@entropealabs.com>
Thu, 16 Apr 2020 14:45:10 +0000 (09:45 -0500)
committerChristopher <chris@entropealabs.com>
Thu, 16 Apr 2020 14:45:10 +0000 (09:45 -0500)
lib/cluster_kv/db.ex

index a1d0b8e006bfa0cdd48d0ec77d910a8f5faedcd4..468235edbf136ca8672a796a23df357d46712cb2 100644 (file)
@@ -21,6 +21,7 @@ defmodule ClusterKV.DB do
           element() | :not_found
   def get(name, key, timeout \\ :infinity) do
     :poolboy.transaction(name, fn w ->
+      Logger.info("GET: #{inspect(key)}")
       GenServer.call(w, {:get, key}, timeout)
     end)
   end
@@ -81,7 +82,7 @@ defmodule ClusterKV.DB do
   end
 
   def handle_call({:get, key}, _from, %DB{db: db} = state) do
-    Logger.debug("DB handling GET #{key}")
+    Logger.info("DB handling GET #{key}")
     {:reply, do_get(db, key), state}
   end
 
@@ -220,6 +221,8 @@ defmodule ClusterKV.DB do
 
   @spec do_get(db :: module(), key :: String.t()) :: element() | :not_found
   defp do_get(db, key) do
+    Logger.info("Lookup: #{inspect(key)}")
+
     case :ets.lookup(db, key) do
       [] -> :not_found
       [other] -> other