A doubt about log exercise

Hello folks!
I want to check something , I think maybe I misunderstood the exercise, because the tests cases don’t behave in the way I expected

The second exercise item ( 2. Send an alert) say something like:

If the log label is error or fatal , send the alert to the ops team.

No matter if it’s legacy or not

But for the “fatal” case is checked at “unknown code sends alert to dev team 1 for a legacy app” test case instead of been check at “fatal code sends alert to ops” test case

As far as i understood, this assert is wrong, it checks fatal level and return dev1

assert LogLevel.alert_recipient(5, true) == :dev1

And It should be added this assert at “fatal code sends alert to ops”

assert LogLevel.alert_recipient(5, true) == :ops

But I no really sure :sweat_smile:

Thanks :slight_smile:

Welcome to the forum!

This test is correct, and it should return :dev1.

level=5 and legacy=true => :unknown, not :fatal.
level=5 is only :fatal if it doesn’t come from a legacy app (check table on the instructions)

1 Like

Hi Andre! Thanks for the welcome :raised_hands:
You are right, it was my bad, I was using the integer log value instead instead of using the label (atom) from LogLevel.to_label/2 function

Thanks a lot !