Routemaster Client v0.3.0 Routemaster.Utils View Source
Utility functions.
Link to this section Summary
Functions
Returns a HTTP Authorization header value from the provided plaintext username and password
Returns a formatted and ANSI-escaped string, useful to produce consistent color coded log messages in development
Returns the current time as a unix timestamp
Checks that a URL is valid and has a HTTPS scheme
Link to this section Functions
Returns a HTTP Authorization header value from the provided plaintext username and password.
Returns a formatted and ANSI-escaped string, useful to produce consistent color coded log messages in development.
For example, this code:
Logger.debug fn() ->
Utils.debug_message(
"My Context",
["A string", ["or", "a"], "IO-list"],
:red
)
end
Will produce this logger output in the terminal, with the formatted message coloured in red:
10:00:42.123 [debug] [My Context] A string or a IO-list
Returns the current time as a unix timestamp.
Checks that a URL is valid and has a HTTPS scheme.