mirror of
https://github.com/benbusby/farside.git
synced 2025-06-22 17:26:36 +00:00
do not log in prod
This commit is contained in:
parent
b73a8b4a4b
commit
876bc2136b
2 changed files with 19 additions and 8 deletions
lib
|
@ -93,16 +93,21 @@ defmodule Farside do
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
def save_results(file, data) do
|
||||
{:ok, file} = File.open(file, [:append])
|
||||
bin = :erlang.term_to_binary(data)
|
||||
IO.binwrite(file, bin)
|
||||
File.close(file)
|
||||
case System.get_env("MIX_ENV") do
|
||||
"prod" ->
|
||||
nil
|
||||
|
||||
_ ->
|
||||
{:ok, file} = File.open(file, [:append])
|
||||
bin = :erlang.term_to_binary(data)
|
||||
IO.binwrite(file, bin)
|
||||
File.close(file)
|
||||
end
|
||||
end
|
||||
|
||||
def restore_term(file) do
|
||||
{:ok,bin} = File.read(file)
|
||||
{:ok, bin} = File.read(file)
|
||||
:erlang.binary_to_term(bin)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue