File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 12
12
//! The last part also means that some Unicode characters might not be
13
13
//! supported by the UEFI console. Don't expect emoji output support.
14
14
15
- use crate :: prelude:: { Boot , SystemTable } ;
16
15
use crate :: proto:: console:: text:: Output ;
16
+ use crate :: system;
17
17
use core:: fmt:: { self , Write } ;
18
18
use core:: ptr;
19
19
use core:: sync:: atomic:: { AtomicPtr , Ordering } ;
@@ -25,9 +25,11 @@ static LOGGER: Logger = Logger::new();
25
25
///
26
26
/// This is unsafe because you must arrange for the logger to be reset with
27
27
/// disable() on exit from UEFI boot services.
28
- pub unsafe fn init ( st : & mut SystemTable < Boot > ) {
28
+ pub unsafe fn init ( ) {
29
29
// Connect the logger to stdout.
30
- LOGGER . set_output ( st. stdout ( ) ) ;
30
+ system:: with_stdout ( |stdout| {
31
+ LOGGER . set_output ( stdout) ;
32
+ } ) ;
31
33
32
34
// Set the logger.
33
35
log:: set_logger ( & LOGGER ) . unwrap ( ) ; // Can only fail if already initialized.
Original file line number Diff line number Diff line change @@ -58,8 +58,7 @@ pub fn init() -> Result<()> {
58
58
// Set up logging.
59
59
#[ cfg( feature = "logger" ) ]
60
60
unsafe {
61
- let mut st = table:: system_table_boot ( ) . expect ( "boot services are not active" ) ;
62
- logger:: init ( & mut st) ;
61
+ logger:: init ( ) ;
63
62
}
64
63
65
64
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments