Skip to content

Conversation

@github-actions
Copy link
Contributor

Summary

Added debug logging to internal/tty/container.go to provide visibility into container environment detection.

Changes

  • File: internal/tty/container.go
  • Logger namespace: tty:container (following pkg:filename convention)
  • Lines changed: +10 insertions
  • Logging calls added: 5

Logging Coverage

The IsRunningInContainer() function now logs:

  1. Function entry: "Detecting container environment"
  2. Method 1 (/.dockerenv): "Container detected: /.dockerenv file exists"
  3. Method 2 (/proc/1/cgroup): "Container detected: found container indicator in /proc/1/cgroup"
  4. Method 3 (env var): "Container detected: RUNNING_IN_CONTAINER=true"
  5. No detection: "No container environment detected"

Benefits

  • Troubleshooting: Easily identify which container detection method succeeds or fails
  • Debugging: Understand why containerization detection behaves differently in various environments
  • Visibility: Track detection flow when DEBUG=tty:* is enabled

Testing

Enable debug logging to see container detection in action:

DEBUG=tty:* ./awmg --config config.toml

Quality Checklist

  • ✅ Exactly 1 file modified (focused, single-file PR)
  • ✅ No test files modified
  • ✅ Logger declaration follows pkg:filename convention
  • ✅ Logger arguments have no side effects
  • ✅ Logging messages are meaningful and helpful
  • ✅ No duplicate logging
  • ✅ Import statements properly formatted
  • ✅ Follows AGENTS.md logging guidelines

Related

Part of the ongoing effort to enhance debugging capabilities across the codebase with consistent, meaningful debug logging.

AI generated by Go Logger Enhancement

- Added logger import and declaration following pkg:filename convention
- Added logging for function entry
- Added logging for each detection method success
- Added logging when no container environment is detected

This provides visibility into which container detection method succeeds,
helping troubleshoot containerization issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants