Last active
December 29, 2017 19:20
-
-
Save jasongoodwin/45be39b6e1f817ee3063a8bf20856d7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule LoggingFake do | |
@moduledoc """ | |
This server is a Fake. | |
It will log the messages received. | |
Helpful stub of a genserver. | |
""" | |
use GenServer | |
require Logger | |
def handle_call(msg, _from, state) do | |
Logger.info("fake metrics: Received #{inspect msg}") | |
{:reply, state, state} | |
end | |
def handle_cast(msg, state) do | |
Logger.info("fake metrics: Received #{inspect msg}") | |
{:noreply, state} | |
end | |
def start_link(_) do | |
GenServer.start_link(__MODULE__, [], name: __MODULE__) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment