Struct Args
pub struct Args {
dir: Vec<PathBuf>,
follow: bool,
kernel: bool,
kernel_only: bool,
service: Vec<String>,
target: Vec<String>,
since: DateTimeArg,
until: Option<DateTimeArg>,
}Expand description
View log files.
--since and --until define a half-open time range of log events to
include in the output. If not specified, --since defaults to 1 hour ago
and --until is not set.
Fields§
§dir: Vec<PathBuf>Directory containing log files.
follow: boolFollow log files as they are written.
kernel: boolInclude kernel log events.
kernel_only: boolOnly include kernel log events, not service log events.
service: Vec<String>Services to include in the output.
target: Vec<String>Target prefixes to include in the output.
since: DateTimeArgStart of the time range to include in the output.
Can be either an RFC3339 timestamp, a relative duration, “now” or “boot”.
until: Option<DateTimeArg>(Exclusive) End of the time range to include in the output.
Can be either an RFC3339 timestamp, a relative duration, “now” or “boot”.
Implementations§
§impl Args
impl Args
const fn wants_kernel(&self) -> bool
const fn wants_kernel(&self) -> bool
Whether to include kernel log events.
const fn wants_any_services(&self) -> bool
const fn wants_any_services(&self) -> bool
Whether to include any service log events.
fn wants_service(&self, service: &str) -> bool
fn wants_service(&self, service: &str) -> bool
Whether to include service log events for the given service.
fn wants_target(&self, target: &str) -> bool
fn wants_target(&self, target: &str) -> bool
Whether to include log events for the given target.
fn order_timestamp(&self, timestamp: DateTime<Utc>) -> Ordering
fn order_timestamp(&self, timestamp: DateTime<Utc>) -> Ordering
Compares the given timestamp to the desired time span.
Returns Ordering::Less if the timestamp is before the since time,
Ordering::Greater if the timestamp is after the until time, and
Ordering::Equal if the timestamp is within the desired time span.
fn wants_timestamp(&self, timestamp: DateTime<Utc>) -> bool
fn wants_timestamp(&self, timestamp: DateTime<Utc>) -> bool
Whether to include log events with the given timestamp.
fn wants_timestamp_range(
&self,
(start, end): (DateTime<Utc>, DateTime<Utc>),
) -> bool
fn wants_timestamp_range( &self, (start, end): (DateTime<Utc>, DateTime<Utc>), ) -> bool
Whether to include any log events from within the given time range.
The time range is given as a half-open interval [start, end).
A return value of true indicates that some timestamps within the
range are of interest, not necessarily all.
Specific timestamps must still be checked with
Args::wants_timestamp.
Trait Implementations§
§impl Args for Args
impl Args for Args
§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
ArgGroup::id][crate::ArgGroup::id] for this set of arguments§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read more§impl FromArgMatches for Args
impl FromArgMatches for Args
§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.