Replace deprecated simple_logger initialization

This commit is contained in:
Logan Magee 2020-09-09 17:58:30 -08:00 committed by GitHub
parent c66489dbb1
commit e4754999b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 47 additions and 21 deletions

View file

@ -1,5 +1,6 @@
use std::{thread, time};
use simple_logger::SimpleLogger;
use winit::{
event::{Event, KeyboardInput, WindowEvent},
event_loop::{ControlFlow, EventLoop},
@ -17,7 +18,7 @@ const WAIT_TIME: time::Duration = time::Duration::from_millis(100);
const POLL_SLEEP_TIME: time::Duration = time::Duration::from_millis(100);
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
println!("Press '1' to switch to Wait mode.");
println!("Press '2' to switch to WaitUntil mode.");

View file

@ -1,3 +1,4 @@
use simple_logger::SimpleLogger;
use winit::{
event::{ElementState, Event, KeyboardInput, WindowEvent},
event_loop::{ControlFlow, EventLoop},
@ -5,7 +6,7 @@ use winit::{
};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = WindowBuilder::new().build(&event_loop).unwrap();

View file

@ -1,3 +1,4 @@
use simple_logger::SimpleLogger;
use winit::{
event::{DeviceEvent, ElementState, Event, KeyboardInput, ModifiersState, WindowEvent},
event_loop::{ControlFlow, EventLoop},
@ -5,7 +6,7 @@ use winit::{
};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = WindowBuilder::new()

View file

@ -1,5 +1,6 @@
#[cfg(not(target_arch = "wasm32"))]
fn main() {
use simple_logger::SimpleLogger;
use winit::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
@ -11,7 +12,7 @@ fn main() {
Timer,
}
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::<CustomEvent>::with_user_event();
let _window = WindowBuilder::new()

View file

@ -1,11 +1,13 @@
use std::io::{stdin, stdout, Write};
use simple_logger::SimpleLogger;
use winit::event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent};
use winit::event_loop::{ControlFlow, EventLoop};
use winit::monitor::{MonitorHandle, VideoMode};
use winit::window::{Fullscreen, WindowBuilder};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
print!("Please choose the fullscreen mode: (1) exclusive, (2) borderless: ");

View file

@ -1,3 +1,4 @@
use simple_logger::SimpleLogger;
use winit::{
event::{Event, KeyboardInput, WindowEvent},
event_loop::{ControlFlow, EventLoop},
@ -5,7 +6,7 @@ use winit::{
};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let _window = WindowBuilder::new()

View file

@ -1,3 +1,4 @@
use simple_logger::SimpleLogger;
use winit::{
dpi::LogicalSize,
event::{Event, WindowEvent},
@ -6,7 +7,7 @@ use winit::{
};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = WindowBuilder::new().build(&event_loop).unwrap();

View file

@ -1,11 +1,12 @@
extern crate winit;
use simple_logger::SimpleLogger;
use winit::event::{Event, VirtualKeyCode, WindowEvent};
use winit::event_loop::{ControlFlow, EventLoop};
use winit::window::WindowBuilder;
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = WindowBuilder::new()

View file

@ -1,7 +1,8 @@
use simple_logger::SimpleLogger;
use winit::{event_loop::EventLoop, window::WindowBuilder};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = WindowBuilder::new().build(&event_loop).unwrap();

View file

@ -2,6 +2,7 @@
fn main() {
use std::{collections::HashMap, sync::mpsc, thread, time::Duration};
use simple_logger::SimpleLogger;
use winit::{
dpi::{PhysicalPosition, PhysicalSize, Position, Size},
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
@ -12,7 +13,7 @@ fn main() {
const WINDOW_COUNT: usize = 3;
const WINDOW_SIZE: PhysicalSize<u32> = PhysicalSize::new(600, 400);
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let mut window_senders = HashMap::with_capacity(WINDOW_COUNT);
for _ in 0..WINDOW_COUNT {

View file

@ -1,4 +1,6 @@
use std::collections::HashMap;
use simple_logger::SimpleLogger;
use winit::{
event::{ElementState, Event, KeyboardInput, WindowEvent},
event_loop::{ControlFlow, EventLoop},
@ -6,7 +8,7 @@ use winit::{
};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let mut windows = HashMap::new();

View file

@ -1,3 +1,4 @@
use simple_logger::SimpleLogger;
use winit::{
event::{ElementState, Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
@ -5,7 +6,7 @@ use winit::{
};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = WindowBuilder::new()

View file

@ -1,5 +1,6 @@
use std::{thread, time};
use simple_logger::SimpleLogger;
use winit::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
@ -7,7 +8,7 @@ use winit::{
};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = WindowBuilder::new()

View file

@ -1,3 +1,4 @@
use simple_logger::SimpleLogger;
use winit::{
dpi::LogicalSize,
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
@ -6,7 +7,7 @@ use winit::{
};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let mut resizable = false;

View file

@ -1,5 +1,7 @@
use instant::Instant;
use std::time::Duration;
use simple_logger::SimpleLogger;
use winit::{
event::{Event, StartCause, WindowEvent},
event_loop::{ControlFlow, EventLoop},
@ -7,7 +9,7 @@ use winit::{
};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let _window = WindowBuilder::new()

View file

@ -1,3 +1,4 @@
use simple_logger::SimpleLogger;
use winit::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
@ -5,7 +6,7 @@ use winit::{
};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = WindowBuilder::new()

View file

@ -1,7 +1,8 @@
use simple_logger::SimpleLogger;
use winit::event_loop::EventLoop;
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let monitor = match event_loop.primary_monitor() {
Some(monitor) => monitor,

View file

@ -1,3 +1,4 @@
use simple_logger::SimpleLogger;
use winit::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
@ -5,7 +6,7 @@ use winit::{
};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = WindowBuilder::new()

View file

@ -1,5 +1,6 @@
// This example is used by developers to test various window functions.
use simple_logger::SimpleLogger;
use winit::{
dpi::{LogicalSize, PhysicalSize},
event::{DeviceEvent, ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
@ -8,7 +9,7 @@ use winit::{
};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let event_loop = EventLoop::new();
let window = WindowBuilder::new()

View file

@ -1,5 +1,7 @@
extern crate image;
use std::path::Path;
use simple_logger::SimpleLogger;
use winit::{
event::Event,
event_loop::{ControlFlow, EventLoop},
@ -7,7 +9,7 @@ use winit::{
};
fn main() {
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
// You'll have to choose an icon size at your own discretion. On X11, the desired size varies
// by WM, and on Windows, you still have to account for screen scaling. Here we use 32px,

View file

@ -10,6 +10,8 @@
))]
fn main() {
use std::{thread::sleep, time::Duration};
use simple_logger::SimpleLogger;
use winit::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
@ -18,7 +20,7 @@ fn main() {
};
let mut event_loop = EventLoop::new();
simple_logger::init().unwrap();
SimpleLogger::new().init().unwrap();
let _window = WindowBuilder::new()
.with_title("A fantastic window!")
.build(&event_loop)