Skip to content

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