Skip to content

Commit 24a76d0

Browse files
committed
fix(node): exclude syslog from log-type in Windows
1 parent 491ba01 commit 24a76d0

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

tox_node/src/node_config.rs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,45 +35,40 @@ impl FromStr for Threads {
3535
}
3636
}
3737

38-
#[cfg(unix)]
3938
/// Specifies where to write logs.
4039
#[derive(Clone, Copy, PartialEq, Eq, Debug, Deserialize)]
4140
pub enum LogType {
4241
Stderr,
4342
Stdout,
43+
#[cfg(unix)]
4444
Syslog,
4545
None,
4646
}
4747

4848
impl ValueEnum for LogType {
4949
fn value_variants<'a>() -> &'a [Self] {
5050
use self::LogType::*;
51-
&[Stderr, Stdout, Syslog, None]
51+
&[
52+
Stderr,
53+
Stdout,
54+
#[cfg(unix)]
55+
Syslog,
56+
None,
57+
]
5258
}
5359

5460
fn to_possible_value<'a>(&self) -> Option<PossibleValue> {
5561
use self::LogType::*;
5662
Some(match self {
5763
Stderr => PossibleValue::new("Stderr"),
5864
Stdout => PossibleValue::new("Stdout"),
65+
#[cfg(unix)]
5966
Syslog => PossibleValue::new("Syslog"),
60-
None => PossibleValue::new("None")
67+
None => PossibleValue::new("None"),
6168
})
6269
}
6370
}
6471

65-
66-
#[cfg(not(unix))]
67-
arg_enum! {
68-
/// Specifies where to write logs.
69-
#[derive(Clone, Copy, PartialEq, Eq, Debug, Deserialize)]
70-
pub enum LogType {
71-
Stderr,
72-
Stdout,
73-
None,
74-
}
75-
}
76-
7772
/// Bootstrap node with generic string address which might be either IP address
7873
/// or DNS name.
7974
#[derive(Clone, PartialEq, Eq, Debug, Deserialize)]

0 commit comments

Comments
 (0)