glimt/serializer/json

Types

pub type JsonSerializerBuilder(data, context, result_type) =
  fn(LogMessage(data, context, result_type)) ->
    List(#(String, Json))

Functions

pub fn add_context(builder: fn(LogMessage(a, b, c)) ->
    List(#(String, Json)), context_serializer: fn(b) -> Json) -> fn(
  LogMessage(a, b, c),
) -> List(#(String, Json))

Add serializer for context data

pub fn add_data(builder: fn(LogMessage(a, b, c)) ->
    List(#(String, Json)), data_serializer: fn(a) -> Json) -> fn(
  LogMessage(a, b, c),
) -> List(#(String, Json))

Add serializer for additional data

pub fn add_standard_log_message(builder: fn(LogMessage(a, b, c)) ->
    List(#(String, Json))) -> fn(LogMessage(a, b, c)) ->
  List(#(String, Json))

Add standard log message to serializer

pub fn build(builder: fn(LogMessage(a, b, c)) ->
    List(#(String, Json))) -> fn(LogMessage(a, b, c)) -> String

Create a serializer from builder

pub fn builder() -> fn(LogMessage(a, b, c)) ->
  List(#(String, Json))

Create a JSON serializer builder

pub fn new_json_serializer() -> fn(LogMessage(a, b, c)) -> String

Creates a new JSON serializer that includes standard log data

Search Document