wip: currently rewriting the project as a full stack application tangled.org/kacaii.dev/sigo
gleam
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

:loud_sound: log when an user successfully signs up

Kacaii 452aa260 a73b602c

+18
+4
justfile
··· 22 22 build: 23 23 gleam export erlang-shipment 24 24 25 + #  Runs erlang-shipment entrypoint 25 26 [group(' ship')] 26 27 prod: 27 28 ./build/erlang-shipment/entrypoint.sh run ··· 72 73 [group(' dev')] 73 74 @clear_log_file: 74 75 echo "" > priv/log/server.log 76 + 77 + @peek_log_file: 78 + bat priv/log/server.log
+14
src/app/routes/signup.gleam
··· 4 4 import formal/form 5 5 import gleam/result 6 6 import gleam/string 7 + import glight 7 8 import pog 8 9 import wisp 9 10 ··· 61 62 Ok(signup) -> { 62 63 case try_insert_into_database(signup:, ctx:) { 63 64 Ok(_) -> { 65 + log_signup(signup) 64 66 wisp.created() 65 67 |> wisp.set_body(wisp.Text("Cadastro realizado com sucesso")) 66 68 } ··· 168 170 } 169 171 } 170 172 } 173 + } 174 + 175 + fn log_signup(signup: SignUp) -> Nil { 176 + glight.logger() 177 + |> glight.with("name", signup.name) 178 + |> glight.with("registration", signup.registration) 179 + |> glight.with("phone_number", signup.phone_number) 180 + |> glight.with("email", signup.email) 181 + |> glight.info("signup") 182 + 183 + // Set back to debug after logging 184 + glight.set_log_level(glight.Debug) 171 185 } 172 186 173 187 ///  Signup can fail