Skip to content

Commit

Permalink
update 1.79.0-nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
s1rius committed Apr 1, 2024
1 parent 5852200 commit ad44cdc
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2023-10-13
toolchain: nightly-2024-03-31
components: ${{ matrix.components }}
- name: Install android target
if: ${{ runner.os == 'Linux' }}
Expand All @@ -45,11 +45,11 @@ jobs:
- name: Add Linux rust std
if: ${{ runner.os == 'Linux' }}
run: >
rustup component add rust-src --toolchain nightly-2023-10-13-x86_64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2024-03-31-x86_64-unknown-linux-gnu
- name: Add macOS rust std
if: ${{ runner.os == 'macOS' }}
run: >
rustup component add rust-src --toolchain nightly-2023-10-13-x86_64-apple-darwin
rustup component add rust-src --toolchain nightly-2024-03-31-x86_64-apple-darwin
- name: Build & Test - ezlog All Features
run: cargo test --manifest-path ./ezlog-core/Cargo.toml --verbose --all-features --no-fail-fast
- name: Build & Test - ezlog_cli
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2023-10-13
toolchain: nightly-2024-03-31
override: true
components: rustfmt, clippy

Expand All @@ -23,7 +23,7 @@ jobs:
- name: Add macOS rust std
run: >
rustup component add rust-src --toolchain nightly-2023-10-13-x86_64-apple-darwin
rustup component add rust-src --toolchain nightly-2024-03-31-x86_64-apple-darwin
- name: Build xcframework
working-directory: ./ios
Expand Down
20 changes: 18 additions & 2 deletions ezlog-core/src/appender.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
use std::{
fs::OpenOptions,
io::{
self,
BufReader,
BufWriter,
Cursor,
Error,
ErrorKind,
Read,
Write,
},
path::PathBuf,
rc::Rc,
};

use memmap2::MmapMut;
use time::OffsetDateTime;

use crate::{
errors,
events::event,
logger::Header,
*,
logger::{
self,
Header,
},
EZLogConfig,
Event,
Result,
};

pub trait AppenderInner: Write {
Expand Down Expand Up @@ -466,6 +477,11 @@ mod tests {

use super::*;
use crate::config::EZLogConfigBuilder;
use crate::{
CipherKind,
CompressKind,
Version,
};

fn create_all_feature_config() -> EZLogConfigBuilder {
let key = b"an example very very secret key.";
Expand Down
2 changes: 0 additions & 2 deletions ezlog-core/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ pub(crate) fn android_print(record: std::fmt::Arguments) {
android_logger::log(&s);
}

pub(crate) use println_with_time;

use crate::errors::LogError;

struct NopEvent;
Expand Down
16 changes: 13 additions & 3 deletions ezlog-core/src/ffi_c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@ use libc::c_uchar;
use libc::c_uint;
use libc::c_void;
use time::Duration;
use time::OffsetDateTime;

use crate::config::Level;
use crate::create_log;
use crate::event;
use crate::events::EventPrinter;
use crate::recorder::EZRecordBuilder;
use crate::*;
use crate::set_boxed_callback;
use crate::thread_name;
use crate::CipherKind;
use crate::CompressKind;
use crate::CompressLevel;
use crate::EZLogCallback;
use crate::EZLogConfigBuilder;
use crate::Event;

/// Init ezlog, must call before any other function
#[no_mangle]
Expand Down Expand Up @@ -108,7 +118,7 @@ pub unsafe extern "C" fn ezlog_log(
.thread_id(thread_id::get())
.thread_name(thread_name::get())
.build();
log(record)
crate::log(record)
}

#[no_mangle]
Expand Down Expand Up @@ -194,7 +204,7 @@ impl EZLogCallback for Callback {

fn on_fetch_fail(&self, name: &str, date: &str, err_msg: &str) {
self.fail(name, date, err_msg).unwrap_or_else(|e| {
events::event!(Event::FFiError, "fetch fail nul", &e.into());
event!(Event::FFiError, "fetch fail nul", &e.into());
});
}
}
Expand Down
9 changes: 1 addition & 8 deletions ezlog-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,7 @@ use std::error::Error;
use std::path::PathBuf;
use std::{
collections::HashMap,
hash::Hash,
io::{
self,
Cursor,
Read,
Write,
},
io::Write,
mem::MaybeUninit,
sync::Once,
thread,
Expand All @@ -84,7 +78,6 @@ use crossbeam_channel::{
Sender,
TrySendError,
};
use memmap2::MmapMut;
use time::Duration;
use time::OffsetDateTime;

Expand Down
4 changes: 3 additions & 1 deletion ezlog-core/src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ use crate::crypto::{
Aes128GcmSiv,
Aes256GcmSiv,
};
use crate::events::Event::{self,};
use crate::events::Event::{
self,
};
use crate::{
appender::EZAppender,
compress::ZlibCodec,
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2023-10-13
nightly-2024-03-31

0 comments on commit ad44cdc

Please sign in to comment.