Skip to content

Replace debug IO.puts statements with Logger in PlayerLive.Show (#2287)#2298

Merged
sydseter merged 4 commits intoOWASP:masterfrom
immortal71:fix/logger-calls-2287
Feb 23, 2026
Merged

Replace debug IO.puts statements with Logger in PlayerLive.Show (#2287)#2298
sydseter merged 4 commits intoOWASP:masterfrom
immortal71:fix/logger-calls-2287

Conversation

@immortal71
Copy link
Copy Markdown
Contributor

@immortal71 immortal71 commented Feb 19, 2026

Summary

  • replace IO.puts debug statements in copi.owasp.org/lib/copi_web/live/player_live/show.ex
  • add require Logger
  • use Logger.debug/1 for routine vote/continue-vote flow messages
  • use Logger.warning/1 for failed vote/continue-vote operations

Why (Reason)

IO.puts is not suitable for production logging in Elixir apps because it bypasses level-based filtering and logger backends.

Changes

  • IO.puts("Continue vote added successfully") -> Logger.debug(...)
  • IO.puts("Continue voting failed") -> Logger.warning(...)
  • IO.puts("player has voted") -> Logger.debug(...)
  • IO.puts("player hasn't voted") -> Logger.debug(...)
  • IO.puts("voted successfully") -> Logger.debug(...)
  • IO.puts("voting failed") -> Logger.warning(...)

All new log messages include relevant identifiers (player_id, game_id, dealt_card_id) for easier diagnostics.

Validation

  • mix compile passes in copi.owasp.org

Closes #2287

Copilot AI review requested due to automatic review settings February 19, 2026 10:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces debug IO.puts statements with proper Logger calls in the PlayerLive.Show module, addressing technical debt from development. IO.puts writes directly to stdout without log levels, timestamps, or structured logging support, making it unsuitable for production. The changes convert 6 debug statements to appropriate Logger calls with added context (player_id, game_id, dealt_card_id) for better diagnostics.

Changes:

  • Added require Logger to enable Logger macros
  • Replaced successful operation messages with Logger.debug/1 for routine vote/continue-vote flows
  • Replaced failure messages with Logger.warning/1 for failed vote operations
  • Enhanced log messages to include relevant identifiers for easier troubleshooting

@immortal71
Copy link
Copy Markdown
Contributor Author

@sydseter is this good to go ?

@sydseter
Copy link
Copy Markdown
Collaborator

@immortal71 Some of your commits are lacking a verified signature.

@immortal71 immortal71 force-pushed the fix/logger-calls-2287 branch 2 times, most recently from 9f382bd to 1175d30 Compare February 20, 2026 02:02
@immortal71 immortal71 force-pushed the fix/logger-calls-2287 branch from 1175d30 to a0e2289 Compare February 20, 2026 02:09
@immortal71
Copy link
Copy Markdown
Contributor Author

@sydseter done

@immortal71
Copy link
Copy Markdown
Contributor Author

@sydseter waiting for the review !!

@sydseter sydseter merged commit 703f742 into OWASP:master Feb 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace debug IO.puts statements with proper Logger calls in copi.owasp.org

3 participants