Current section

Files

Jump to
go_over src go_over@util@print.erl
Raw

src/go_over@util@print.erl

-module(go_over@util@print).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/go_over/util/print.gleam").
-export([raw/2, progress/1, format_warning/1, format_critical/1, format_high/1, format_moderate/1, format_low/1, warning/1, high/1, success/1]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(false).
-file("src/go_over/util/print.gleam", 6).
?DOC(false).
-spec raw(binary(), binary()) -> binary().
raw(Msg, Color) ->
shellout:style(Msg, shellout:color([Color]), []).
-file("src/go_over/util/print.gleam", 10).
?DOC(false).
-spec progress(binary()) -> nil.
progress(Msg) ->
gxyz@function:iff_nil(
go_over@util@globals:verbose(),
fun() ->
_pipe = shellout:style(
Msg,
shellout:color([<<"brightmagenta"/utf8>>]),
[]
),
gleam_stdlib:println(_pipe)
end
).
-file("src/go_over/util/print.gleam", 17).
?DOC(false).
-spec format_warning(binary()) -> binary().
format_warning(Msg) ->
shellout:style(
<<Msg/binary, "\n"/utf8>>,
shellout:color([<<"red"/utf8>>]),
[]
).
-file("src/go_over/util/print.gleam", 21).
?DOC(false).
-spec format_critical(binary()) -> binary().
format_critical(Msg) ->
format_warning(Msg).
-file("src/go_over/util/print.gleam", 25).
?DOC(false).
-spec format_high(binary()) -> binary().
format_high(Msg) ->
shellout:style(
<<Msg/binary, "\n"/utf8>>,
shellout:color([<<"yellow"/utf8>>]),
[]
).
-file("src/go_over/util/print.gleam", 29).
?DOC(false).
-spec format_moderate(binary()) -> binary().
format_moderate(Msg) ->
shellout:style(
<<Msg/binary, "\n"/utf8>>,
shellout:color([<<"blue"/utf8>>]),
[]
).
-file("src/go_over/util/print.gleam", 33).
?DOC(false).
-spec format_low(binary()) -> binary().
format_low(Msg) ->
shellout:style(
<<Msg/binary, "\n"/utf8>>,
shellout:color([<<"cyan"/utf8>>]),
[]
).
-file("src/go_over/util/print.gleam", 37).
?DOC(false).
-spec warning(binary()) -> nil.
warning(Msg) ->
_pipe = Msg,
_pipe@1 = format_warning(_pipe),
gleam_stdlib:println(_pipe@1).
-file("src/go_over/util/print.gleam", 43).
?DOC(false).
-spec high(binary()) -> nil.
high(Msg) ->
_pipe = Msg,
_pipe@1 = format_high(_pipe),
gleam_stdlib:println(_pipe@1).
-file("src/go_over/util/print.gleam", 49).
?DOC(false).
-spec success(binary()) -> nil.
success(Msg) ->
_pipe = shellout:style(Msg, shellout:color([<<"brightgreen"/utf8>>]), []),
gleam_stdlib:println(_pipe).