Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update 1.79.0-nightly #122

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 3 additions & 2 deletions 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 Expand Up @@ -224,7 +226,6 @@ impl EZLogger {
Box::new(move |input| xor_slice(input, &combine))
}

///
#[inline]
pub fn encode_as_block(&mut self, record: &EZRecord) -> Result<Vec<u8>> {
let buf = self.encode(record)?;
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
Loading