smithay/src/lib.rs

39 lines
947 B
Rust
Raw Normal View History

2018-12-15 20:58:43 +00:00
#![warn(missing_docs, rust_2018_idioms)]
//! **Smithay: the Wayland compositor smithy**
//!
//! Most entry points in the modules can take an optional [`slog::Logger`](::slog::Logger) as argument
//! that will be used as a drain for logging. If `None` is provided, they'll log to `slog-stdlog`.
2017-09-18 14:58:20 +00:00
// `error_chain!` can recurse deeply
#![recursion_limit = "1024"]
2017-03-11 08:15:17 +00:00
2017-12-21 15:01:16 +00:00
#[cfg_attr(feature = "backend_session", macro_use)]
2018-12-13 17:48:54 +00:00
#[doc(hidden)]
pub extern crate nix;
2017-02-22 10:00:03 +00:00
#[macro_use]
extern crate slog;
2017-09-18 14:58:20 +00:00
#[macro_use]
extern crate error_chain;
2017-12-09 16:32:22 +00:00
#[macro_use]
extern crate lazy_static;
2017-03-07 10:53:57 +00:00
pub mod backend;
2017-09-22 08:46:00 +00:00
pub mod utils;
2019-02-05 16:26:09 +00:00
#[cfg(feature = "wayland_frontend")]
2018-09-24 22:32:09 +00:00
pub mod wayland;
2018-04-30 19:28:17 +00:00
#[cfg(feature = "xwayland")]
pub mod xwayland;
2018-12-13 17:48:54 +00:00
pub mod reexports;
fn slog_or_stdlog<L>(logger: L) -> ::slog::Logger
2017-06-20 09:31:18 +00:00
where
L: Into<Option<::slog::Logger>>,
{
use slog::Drain;
2017-09-05 17:50:22 +00:00
logger
.into()
.unwrap_or_else(|| ::slog::Logger::root(::slog_stdlog::StdLog.fuse(), o!()))
}