Skip to content

Commit 2a37993

Browse files
committed
Hide some private functions from public docs
1 parent fb51bf8 commit 2a37993

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

lib/logger_json/formatters/datadog.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ defmodule LoggerJSON.Formatters.Datadog do
188188
""
189189
end
190190

191-
def safe_chardata_to_string(chardata) when is_list(chardata) or is_binary(chardata) do
191+
defp safe_chardata_to_string(chardata) when is_list(chardata) or is_binary(chardata) do
192192
IO.chardata_to_string(chardata)
193193
end
194194

195-
def safe_chardata_to_string(other), do: other
195+
defp safe_chardata_to_string(other), do: other
196196

197197
if Code.ensure_loaded?(Plug.Conn) do
198198
defp format_http_request(%{conn: %Plug.Conn{} = conn} = meta) do

lib/logger_json/formatters/elastic.ex

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,8 @@ defmodule LoggerJSON.Formatters.Elastic do
188188
defp get_exception_code(%{code: code}), do: code
189189
defp get_exception_code(_), do: nil
190190

191-
@doc """
192-
Formats the error fields as specified in https://www.elastic.co/guide/en/ecs/8.11/ecs-error.html
193-
"""
194-
def format_error_fields(message, error_message, stacktrace, type) do
191+
# Formats the error fields as specified in https://www.elastic.co/guide/en/ecs/8.11/ecs-error.html
192+
defp format_error_fields(message, error_message, stacktrace, type) do
195193
%{
196194
message: message,
197195
"error.message": error_message,
@@ -200,10 +198,8 @@ defmodule LoggerJSON.Formatters.Elastic do
200198
}
201199
end
202200

203-
@doc """
204-
Formats the log.logger and log.origin fields as specified in https://www.elastic.co/guide/en/ecs/8.11/ecs-log.html
205-
"""
206-
def format_logger_fields(%{file: file, line: line, mfa: {module, function, arity}}) do
201+
# Formats the log.logger and log.origin fields as specified in https://www.elastic.co/guide/en/ecs/8.11/ecs-log.html
202+
defp format_logger_fields(%{file: file, line: line, mfa: {module, function, arity}}) do
207203
%{
208204
"log.logger": module,
209205
"log.origin": %{
@@ -214,7 +210,7 @@ defmodule LoggerJSON.Formatters.Elastic do
214210
}
215211
end
216212

217-
def format_logger_fields(_meta), do: nil
213+
defp format_logger_fields(_meta), do: nil
218214

219215
if Code.ensure_loaded?(Plug.Conn) do
220216
# See the formats for the following fields in ECS:
@@ -245,9 +241,9 @@ defmodule LoggerJSON.Formatters.Elastic do
245241
defp format_trace_id(%{trace_id: trace_id}), do: trace_id
246242
defp format_trace_id(_meta), do: nil
247243

248-
def safe_chardata_to_string(chardata) when is_list(chardata) or is_binary(chardata) do
244+
defp safe_chardata_to_string(chardata) when is_list(chardata) or is_binary(chardata) do
249245
IO.chardata_to_string(chardata)
250246
end
251247

252-
def safe_chardata_to_string(other), do: other
248+
defp safe_chardata_to_string(other), do: other
253249
end

lib/logger_json/formatters/google_cloud.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,9 @@ defmodule LoggerJSON.Formatters.GoogleCloud do
330330
defp format_trace(_meta, _project_id_or_nil),
331331
do: nil
332332

333-
def safe_chardata_to_string(chardata) when is_list(chardata) or is_binary(chardata) do
333+
defp safe_chardata_to_string(chardata) when is_list(chardata) or is_binary(chardata) do
334334
IO.chardata_to_string(chardata)
335335
end
336336

337-
def safe_chardata_to_string(other), do: other
337+
defp safe_chardata_to_string(other), do: other
338338
end

0 commit comments

Comments
 (0)