   defp level_to_number(:error), do: 3
 
   def translation_data do
-    read_data!(:translation_data)
+    read_data!(@data_key)
   end
 
   def log_data(level) do
-    %{level: min_level} = config = read_data!(:log_data)
+    %{level: min_level} = config = read_data!(@data_key)
 
     if compare_levels(level, min_level) != :lt do
       %{thresholds: {counter, sync, discard}} = config

  end

  def level do
    %{level: level} = read_data!(:translation_data)
    level
  end


    discard_threshold = Application.fetch_env!(:logger, :discard_threshold)
    discard_period = Application.fetch_env!(:logger, :discard_threshold_periodic_check)

    data = %{
      level: Application.fetch_env!(:logger, :level),
      utc_log: Application.fetch_env!(:logger, :utc_log),
      truncate: Application.fetch_env!(:logger, :truncate),
      translators: Application.fetch_env!(:logger, :translators),
      thresholds: {counter, sync_threshold, discard_threshold}
    }

    update_data(@data_key, data)
    {counter, :log, discard_threshold, discard_period}
  end

  defp read_data!(key) do
    try do
      read_data(key, nil)
    rescue
      ArgumentError ->
        raise "cannot use Logger, the :logger application is not running"
