Logfmt v1.0.1 Logfmt.Decoder

This module contains functions to decode logfmt strings into a Keyword.t

Summary

Functions

Same as decode!/1 except that it returns the error inline instead of raises

Decodes a logfmt encoded string into a Keyword.t

Types

Functions

decode(input)

Specs

decode(binary) :: {:ok, t} | {:error, String.t}

Same as decode!/1 except that it returns the error inline instead of raises.

Examples

iex> Logfmt.decode("name:\"Timber Technologies\" domain:timber.io awesome:true")
{:ok, [name: "Timber Technologies", domain: "timber.io", awesome: "true"]}
decode!(input)

Specs

decode!(binary) :: t

Decodes a logfmt encoded string into a Keyword.t

Examples

iex> Logfmt.decode!("name:\"Timber Technologies\" domain:timber.io awesome:true")
[name: "Timber Technologies", domain: "timber.io", awesome: "true"]