Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging features to improve observability #38

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

AkshatMittal7
Copy link

This PR introduces logging features to the PTY library to enhance observability and ease debugging. The changes include:

  1. Added logging statements to key functions:

    • Pty::new
    • take_fd
    • pty_resize
    • set_close_on_exec
    • set_nonblocking
  2. Introduced a new is_active method to check PTY state.

  3. Enhanced error messages in take_fd and pty_resize functions.

  4. Added an init_logging function to allow users to easily initialize logging.

  5. Added instructions on how to run tests with logging on

These changes will help developers using this library to:

  • Better understand the flow of operations within the PTY
  • More easily diagnose issues in production environments
  • Have a clearer picture of the PTY's state at any given time

Testing:

  • Added logging statements can be verified by running tests with RUST_LOG=debug

Dependencies added:

  • log = "0.4"
  • env_logger = "0.10"

This PR aims to improve the maintainability and debuggability of the library without changing its core functionality.

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.

1 participant