Timber v1.0.2 Timber.Utils

Utility functions for Timber

Summary

Functions

Drops any nil values from the given map

Formats a timestamp to the format YYYY-MM-DDTHH:MM:SS.SSSSSSZ as chardata

Returns a string representation of the module name with the Elixir. prefix stripped

Returns the current date and time in UTC including fractional portions of a second

Functions

drop_nil_values(map)
drop_nil_values(map) :: map

Drops any nil values from the given map

Only applies to the root level of the map

format_time_ms(time_ms)
format_timestamp(arg)

Formats a timestamp to the format YYYY-MM-DDTHH:MM:SS.SSSSSSZ as chardata

The precision of the fractional seconds is variable. BEAM only provides precision timekeeping to the microsecond, which is equivalent to 1000 nanoseconds. However, the Elixir Logger library defaults to millisecond precision (1000 microseconds or 1,000,000 nanoseconds). When formatting the time given by the Elixir Logger library, the fractional seconds are represented to three decimal places. When formatting the time as microseconds, the fractional seconds are represented to six decimal places.

In some cases, the time keeping library may indicate that the microseconds have no precision. In this case, the fractional seconds will be left off entirely, resulting in the following format: YYYY-MM-DDTHH:MM:SSZ.

module_name(module)

Returns a string representation of the module name with the Elixir. prefix stripped.

normalize_headers(headers)

Returns the current date and time in UTC including fractional portions of a second