Skip to content

Commit d046477

Browse files
Copilotjosecelano
andcommitted
refactor: convert user_output.rs to folder module structure
- Created user_output/ folder with organized submodules - Separated core components: theme, channel, verbosity, traits - Organized messages into messages/ subdirectory (7 message types) - Organized sinks into sinks/ subdirectory (4 sink implementations + writers) - Organized formatters into formatters/ subdirectory (JsonFormatter) - Extracted test_support module for test utilities - Co-located all 155 tests with code in core.rs - Maintained 100% backward compatibility - all public APIs unchanged - All tests passing Co-authored-by: josecelano <[email protected]>
1 parent eaa57be commit d046477

File tree

23 files changed

+1877
-1713
lines changed

23 files changed

+1877
-1713
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//! Output channel routing for user-facing messages
2+
//!
3+
//! This module defines the channel enum that determines whether messages
4+
//! should be written to stdout or stderr.
5+
6+
/// Output channel for routing messages
7+
///
8+
/// Determines whether a message should be written to stdout or stderr.
9+
/// Following Unix conventions:
10+
/// - **stdout**: Final results and structured data for piping/redirection
11+
/// - **stderr**: Progress updates, status messages, operational info, errors
12+
///
13+
/// # Examples
14+
///
15+
/// ```rust
16+
/// use torrust_tracker_deployer_lib::presentation::user_output::Channel;
17+
///
18+
/// let channel = Channel::Stdout;
19+
/// assert_eq!(channel, Channel::Stdout);
20+
/// ```
21+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
22+
pub enum Channel {
23+
/// Standard output stream for final results and data
24+
Stdout,
25+
/// Standard error stream for progress and operational messages
26+
Stderr,
27+
}

0 commit comments

Comments
 (0)