View Source Numscriptex.CheckLog (numscriptex v0.2.5)

After you check your numscript you might get a variety of logs even if it is valid, Numscriptex.CheckLog is responsible for standardize these logs.

Summary

Types

t()

Type that represents Numscriptex.CheckLog struct.

Functions

Get a map with log data about a checked numscript.

Types

log_levels()

@type log_levels() :: :error | :warning | :hint | :info

t()

@type t() :: %Numscriptex.CheckLog{
  character: pos_integer(),
  level: log_levels(),
  line: pos_integer(),
  message: binary()
}

Type that represents Numscriptex.CheckLog struct.

Fields

  • :character the character position where the log occurred
  • :level the log level
  • :line the line where the log occur
  • :message the log message

Functions

from_map(map)

@spec from_map(map()) :: t()

Get a map with log data about a checked numscript.

iex> map = %{
...>   character: 10,
...>   level:  :warning,
...>   line: 1,
...>   message: "warning message"
...> }
...>
...> Numscriptex.CheckLog.from_map(map)
%Numscriptex.CheckLog{
  character: 10,
  level:  :warning,
  line: 1,
  message: "warning message"
}