use env_logger in all examples (#2934)

This commit is contained in:
Emil Ernerfeldt 2023-04-19 16:35:38 +02:00 committed by GitHub
parent e3a021eea6
commit ce761e548f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 76 additions and 37 deletions

14
Cargo.lock generated
View File

@ -764,6 +764,7 @@ name = "confirm_exit"
version = "0.1.0"
dependencies = [
"eframe",
"env_logger",
]
[[package]]
@ -910,6 +911,7 @@ version = "0.1.0"
dependencies = [
"eframe",
"egui_glow",
"env_logger",
"glow",
]
@ -918,6 +920,7 @@ name = "custom_font"
version = "0.1.0"
dependencies = [
"eframe",
"env_logger",
]
[[package]]
@ -925,6 +928,7 @@ name = "custom_font_style"
version = "0.1.0"
dependencies = [
"eframe",
"env_logger",
]
[[package]]
@ -932,6 +936,7 @@ name = "custom_window_frame"
version = "0.1.0"
dependencies = [
"eframe",
"env_logger",
]
[[package]]
@ -1129,6 +1134,7 @@ dependencies = [
"eframe",
"egui_extras",
"ehttp",
"env_logger",
"image",
"poll-promise",
]
@ -1505,6 +1511,7 @@ name = "file_dialog"
version = "0.1.0"
dependencies = [
"eframe",
"env_logger",
"rfd",
]
@ -1929,6 +1936,7 @@ name = "hello_world_par"
version = "0.1.0"
dependencies = [
"eframe",
"env_logger",
]
[[package]]
@ -2851,6 +2859,7 @@ name = "puffin_profiler"
version = "0.1.0"
dependencies = [
"eframe",
"env_logger",
"puffin",
"puffin_http",
]
@ -2996,6 +3005,7 @@ version = "0.1.0"
dependencies = [
"eframe",
"egui_extras",
"env_logger",
"image",
]
@ -3173,6 +3183,7 @@ name = "screenshot"
version = "0.1.0"
dependencies = [
"eframe",
"env_logger",
"image",
"itertools",
]
@ -3247,6 +3258,7 @@ name = "serial_windows"
version = "0.1.0"
dependencies = [
"eframe",
"env_logger",
]
[[package]]
@ -3413,6 +3425,7 @@ version = "0.1.0"
dependencies = [
"eframe",
"egui_extras",
"env_logger",
]
[[package]]
@ -3818,6 +3831,7 @@ name = "user_attention"
version = "0.1.0"
dependencies = [
"eframe",
"env_logger",
]
[[package]]

View File

@ -15,8 +15,7 @@ fn main() -> Result<(), eframe::Error> {
std::env::set_var("RUST_LOG", rust_log);
}
// Log to stderr (if you run with `RUST_LOG=debug`).
env_logger::init();
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions {
drag_and_drop_support: true,

View File

@ -12,3 +12,4 @@ publish = false
eframe = { path = "../../crates/eframe", features = [
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }
env_logger = "0.10"

View File

@ -3,6 +3,7 @@
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions {
initial_window_size: Some(egui::vec2(320.0, 240.0)),
..Default::default()

View File

@ -13,4 +13,5 @@ eframe = { path = "../../crates/eframe", features = [
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }
egui_glow = { path = "../../crates/egui_glow" }
env_logger = "0.10"
glow = "0.12"

View File

@ -7,6 +7,7 @@ use egui::mutex::Mutex;
use std::sync::Arc;
fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions {
initial_window_size: Some(egui::vec2(350.0, 380.0)),
multisampling: 4,

View File

@ -12,3 +12,4 @@ publish = false
eframe = { path = "../../crates/eframe", features = [
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }
env_logger = "0.10"

View File

@ -3,6 +3,7 @@
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions {
initial_window_size: Some(egui::vec2(320.0, 240.0)),
..Default::default()

View File

@ -12,3 +12,4 @@ publish = false
eframe = { path = "../../crates/eframe", features = [
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }
env_logger = "0.10"

View File

@ -3,6 +3,17 @@
use eframe::egui;
use egui::{FontFamily, FontId, RichText, TextStyle};
fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions::default();
eframe::run_native(
"egui example: global font style",
options,
Box::new(|cc| Box::new(MyApp::new(cc))),
)
}
#[inline]
fn heading2() -> TextStyle {
TextStyle::Name("Heading2".into())
@ -58,14 +69,4 @@ impl eframe::App for MyApp {
}
}
fn main() -> Result<(), eframe::Error> {
let options = eframe::NativeOptions::default();
eframe::run_native(
"egui example: global font style",
options,
Box::new(|cc| Box::new(MyApp::new(cc))),
)
}
pub const LOREM_IPSUM: &str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";

View File

@ -12,3 +12,4 @@ publish = false
eframe = { path = "../../crates/eframe", features = [
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }
env_logger = "0.10"

View File

@ -5,6 +5,7 @@
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions {
// Hide the OS-specific "chrome" around the window:
decorated: false,

View File

@ -14,5 +14,6 @@ eframe = { path = "../../crates/eframe", features = [
] }
egui_extras = { path = "../../crates/egui_extras", features = ["image"] }
ehttp = "0.2"
env_logger = "0.10"
image = { version = "0.24", default-features = false, features = ["jpeg"] }
poll-promise = "0.2"

View File

@ -5,6 +5,7 @@ use egui_extras::RetainedImage;
use poll_promise::Promise;
fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions::default();
eframe::run_native(
"Download and show an image with eframe/egui",

View File

@ -12,4 +12,5 @@ publish = false
eframe = { path = "../../crates/eframe", features = [
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }
env_logger = "0.10"
rfd = "0.11"

View File

@ -3,6 +3,7 @@
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions {
drag_and_drop_support: true,
initial_window_size: Some(egui::vec2(320.0, 240.0)),

View File

@ -3,9 +3,7 @@
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
// Log to stderr (if you run with `RUST_LOG=debug`).
env_logger::init();
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions {
initial_window_size: Some(egui::vec2(320.0, 240.0)),
..Default::default()

View File

@ -14,3 +14,4 @@ eframe = { path = "../../crates/eframe", default-features = false, features = [
"default_fonts",
"wgpu",
] }
env_logger = "0.10"

View File

@ -8,6 +8,7 @@ use std::thread::JoinHandle;
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions {
initial_window_size: Some(egui::vec2(1024.0, 768.0)),
..Default::default()

View File

@ -3,8 +3,7 @@
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
// Log to stderr (if you run with `RUST_LOG=debug`).
env_logger::init();
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions {
initial_window_size: Some(egui::vec2(320.0, 240.0)),

View File

@ -4,9 +4,7 @@ use eframe::egui;
use egui::*;
fn main() -> Result<(), eframe::Error> {
// Log to stderr (if you run with `RUST_LOG=debug`).
env_logger::init();
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions::default();
eframe::run_native(
"Keyboard events",

View File

@ -13,5 +13,6 @@ eframe = { path = "../../crates/eframe", features = [
"puffin",
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }
env_logger = "0.10"
puffin = "0.14"
puffin_http = "0.11"

View File

@ -3,8 +3,8 @@
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
start_puffin_server(); // NOTE: you may only want to call this if the users specifies some flag or clicks a button!
let options = eframe::NativeOptions::default();
eframe::run_native(
"My egui App",

View File

@ -13,4 +13,5 @@ eframe = { path = "../../crates/eframe", features = [
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }
egui_extras = { path = "../../crates/egui_extras", features = ["image"] }
env_logger = "0.10"
image = { version = "0.24", default-features = false, features = ["png"] }

View File

@ -4,11 +4,11 @@ use eframe::egui;
use egui_extras::RetainedImage;
fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions {
initial_window_size: Some(egui::vec2(300.0, 900.0)),
..Default::default()
};
eframe::run_native(
"Show an image with eframe/egui",
options,

View File

@ -16,5 +16,6 @@ eframe = { path = "../../crates/eframe", features = [
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
"wgpu",
] }
env_logger = "0.10"
itertools = "0.10.3"
image = { version = "0.24", default-features = false, features = ["png"] }

View File

@ -3,6 +3,7 @@
use eframe::egui::{self, ColorImage};
fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions {
renderer: eframe::Renderer::Wgpu,
..Default::default()

View File

@ -12,3 +12,4 @@ publish = false
eframe = { path = "../../crates/eframe", features = [
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }
env_logger = "0.10"

View File

@ -3,6 +3,8 @@
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
if cfg!(target_os = "macos") {
eprintln!("WARNING: this example does not work on Mac! See https://github.com/emilk/egui/issues/1918");
}

View File

@ -13,3 +13,4 @@ eframe = { path = "../../crates/eframe", features = [
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }
egui_extras = { path = "../../crates/egui_extras", features = ["svg"] }
env_logger = "0.10"

View File

@ -7,6 +7,7 @@
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let options = eframe::NativeOptions {
initial_window_size: Some(egui::vec2(1000.0, 700.0)),
..Default::default()

View File

@ -8,4 +8,7 @@ rust-version = "1.65"
publish = false
[dependencies]
eframe = { path = "../../crates/eframe" }
eframe = { path = "../../crates/eframe", features = [
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }
env_logger = "0.10"

View File

@ -1,8 +1,23 @@
use eframe::egui::{Button, CentralPanel, Context, UserAttentionType};
use eframe::{CreationContext, NativeOptions};
use eframe::{
egui::{Button, CentralPanel, Context, UserAttentionType},
CreationContext, NativeOptions,
};
use std::time::{Duration, SystemTime};
fn main() -> eframe::Result<()> {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
let native_options = NativeOptions {
initial_window_size: Some(eframe::egui::vec2(400., 200.)),
..Default::default()
};
eframe::run_native(
"User attention test",
native_options,
Box::new(|cc| Box::new(Application::new(cc))),
)
}
fn repr(attention: UserAttentionType) -> String {
format!("{:?}", attention)
}
@ -116,15 +131,3 @@ impl eframe::App for Application {
ctx.request_repaint_after(Self::repaint_max_timeout());
}
}
fn main() -> eframe::Result<()> {
let native_options = NativeOptions {
initial_window_size: Some(eframe::egui::vec2(400., 200.)),
..Default::default()
};
eframe::run_native(
"User attention test",
native_options,
Box::new(|cc| Box::new(Application::new(cc))),
)
}