1
0
Fork 0

adjust logging levels

This commit is contained in:
Sebastien Bourdeauducq 2020-07-05 23:46:23 +08:00
parent 2c65e6bf6f
commit de8da59e56
3 changed files with 9 additions and 9 deletions

View File

@ -4,7 +4,7 @@ use core::str::Utf8Error;
use alloc::rc::Rc; use alloc::rc::Rc;
use alloc::sync::Arc; use alloc::sync::Arc;
use alloc::{vec, vec::Vec, string::String}; use alloc::{vec, vec::Vec, string::String};
use log::{debug, warn, error}; use log::{info, warn, error};
use num_derive::{FromPrimitive, ToPrimitive}; use num_derive::{FromPrimitive, ToPrimitive};
use num_traits::{FromPrimitive, ToPrimitive}; use num_traits::{FromPrimitive, ToPrimitive};
@ -90,7 +90,7 @@ async fn read_request(stream: &TcpStream, allow_close: bool) -> Result<Option<Re
return Err(Error::UnexpectedPattern), return Err(Error::UnexpectedPattern),
Err(smoltcp::Error::Illegal) => { Err(smoltcp::Error::Illegal) => {
if allow_close { if allow_close {
debug!("peer closed connection"); info!("peer closed connection");
return Ok(None); return Ok(None);
} else { } else {
error!("peer unexpectedly closed connection"); error!("peer unexpectedly closed connection");
@ -210,7 +210,7 @@ async fn handle_run_kernel(stream: &TcpStream, control: &Rc<RefCell<kernel::Cont
async fn handle_connection(stream: &TcpStream, control: Rc<RefCell<kernel::Control>>) -> Result<()> { async fn handle_connection(stream: &TcpStream, control: Rc<RefCell<kernel::Control>>) -> Result<()> {
expect(stream, b"ARTIQ coredev\n").await?; expect(stream, b"ARTIQ coredev\n").await?;
debug!("received connection"); info!("received connection");
loop { loop {
let request = read_request(stream, true).await?; let request = read_request(stream, true).await?;
if request.is_none() { if request.is_none() {

View File

@ -1,5 +1,5 @@
use core::{ptr, mem}; use core::{ptr, mem};
use log::{debug, error}; use log::{debug, info, error};
use alloc::{vec::Vec, sync::Arc}; use alloc::{vec::Vec, sync::Arc};
use cslice::CSlice; use cslice::CSlice;
@ -349,7 +349,7 @@ pub fn main_core1() {
} }
}, },
Message::StartRequest => { Message::StartRequest => {
debug!("kernel starting"); info!("kernel starting");
if let Some(__modinit__) = current_modinit { if let Some(__modinit__) = current_modinit {
unsafe { unsafe {
KERNEL_CHANNEL_0TO1 = mem::transmute(&mut core1_rx); KERNEL_CHANNEL_0TO1 = mem::transmute(&mut core1_rx);
@ -362,7 +362,7 @@ pub fn main_core1() {
KERNEL_CHANNEL_1TO0 = ptr::null_mut(); KERNEL_CHANNEL_1TO0 = ptr::null_mut();
} }
} }
debug!("kernel finished"); info!("kernel finished");
core1_tx.send(Message::KernelFinished); core1_tx.send(Message::KernelFinished);
} }
_ => error!("Core1 received unexpected message: {:?}", message), _ => error!("Core1 received unexpected message: {:?}", message),

View File

@ -1,7 +1,7 @@
use core::str; use core::str;
use core::future::Future; use core::future::Future;
use cslice::{CSlice, CMutSlice}; use cslice::{CSlice, CMutSlice};
use log::debug; use log::trace;
use core_io::{Write, Error}; use core_io::{Write, Error};
use libboard_zynq::smoltcp; use libboard_zynq::smoltcp;
@ -93,7 +93,7 @@ pub async fn recv_return<F>(stream: &TcpStream, tag_bytes: &[u8], data: *mut (),
where F: Future<Output=*mut ()> where F: Future<Output=*mut ()>
{ {
let mut it = TagIterator::new(tag_bytes); let mut it = TagIterator::new(tag_bytes);
debug!("recv ...->{}", it); trace!("recv ...->{}", it);
let tag = it.next().expect("truncated tag"); let tag = it.next().expect("truncated tag");
let mut data = data; let mut data = data;
@ -187,7 +187,7 @@ pub fn send_args<W>(writer: &mut W, service: u32, tag_bytes: &[u8], data: *const
let mut args_it = TagIterator::new(arg_tags_bytes); let mut args_it = TagIterator::new(arg_tags_bytes);
let return_it = TagIterator::new(return_tag_bytes); let return_it = TagIterator::new(return_tag_bytes);
debug!("send<{}>({})->{}", service, args_it, return_it); trace!("send<{}>({})->{}", service, args_it, return_it);
writer.write_u32(service)?; writer.write_u32(service)?;
for index in 0.. { for index in 0.. {