34 Commits

Author SHA1 Message Date
eaf877f59c [release] logtimes v1.0.25 2024-12-02 13:19:24 +01:00
b39aeb0df9 [deps] cargo update
Updating cc                         v1.2.1   -> v1.2.2
Updating js-sys                     v0.3.72  -> v0.3.74
Updating libc                       v0.2.166 -> v0.2.167
Updating syn                        v2.0.89  -> v2.0.90
Updating wasm-bindgen-backend       v0.2.95  -> v0.2.97
Updating wasm-bindgen-macro-support v0.2.95  -> v0.2.97
Updating wasm-bindgen-macro         v0.2.95  -> v0.2.97
Updating wasm-bindgen-shared        v0.2.95  -> v0.2.97
Updating wasm-bindgen               v0.2.95  -> v0.2.97
2024-12-02 13:19:18 +01:00
7b99e90663 [release] logtimes v1.0.24 2024-11-28 15:32:05 +01:00
9ea6a6e224 [deps] cargo update
Updating libc          v0.2.164 -> v0.2.166
Updating proc-macro2   v1.0.89  -> v1.0.92
Updating syn           v2.0.87  -> v2.0.89
Updating unicode-ident v1.0.13  -> v1.0.14
2024-11-28 15:32:04 +01:00
4fd4acec0e [code] remove inline. benchmarks show no difference 2024-11-28 15:31:44 +01:00
7bf1352738 [release] logtimes v1.0.23 2024-11-18 11:54:04 +01:00
7f0a8929fe [deps] cargo update
Updating cc   v1.1.31  -> v1.2.1
Updating libc v0.2.161 -> v0.2.164
Updating syn  v2.0.85  -> v2.0.87
2024-11-18 11:53:57 +01:00
6d776af6d1 [release] logtimes v1.0.22 2024-10-24 11:34:20 +02:00
098b7bbe26 [deps] cargo update
Updating syn v2.0.82 -> v2.0.85
2024-10-24 11:34:13 +02:00
57eed0f5ac [release] logtimes v1.0.21 2024-10-23 16:35:14 +02:00
896acd090f [deps] cargo update
Updating proc-macro2 v1.0.88 -> v1.0.89
2024-10-23 16:35:13 +02:00
3e1d0d8bc7 [release] logtimes v1.0.20 2024-10-21 13:51:05 +02:00
ef9706ec58 [deps] cargo update
Updating cc  v1.1.30 -> v1.1.31
Updating syn v2.0.79 -> v2.0.82
2024-10-21 13:50:56 +02:00
bc536a3308 [release] logtimes v1.0.19 2024-10-18 14:41:25 +02:00
e511fe2679 [deps] cargo update
Updating cc          v1.1.29  -> v1.1.30
Updating libc        v0.2.159 -> v0.2.161
Updating proc-macro2 v1.0.87  -> v1.0.88
2024-10-18 14:41:16 +02:00
92e8b0f498 [release] logtimes v1.0.18 2024-10-11 16:01:00 +02:00
af8642baaa [deps] cargo update
Updating cc                         v1.1.28 -> v1.1.29
Updating js-sys                     v0.3.71 -> v0.3.72
Updating wasm-bindgen-backend       v0.2.94 -> v0.2.95
Updating wasm-bindgen-macro-support v0.2.94 -> v0.2.95
Updating wasm-bindgen-macro         v0.2.94 -> v0.2.95
Updating wasm-bindgen-shared        v0.2.94 -> v0.2.95
Updating wasm-bindgen               v0.2.94 -> v0.2.95
2024-10-11 16:00:53 +02:00
1c973cc44e [release] logtimes v1.0.17 2024-10-10 12:51:00 +02:00
ac388c8517 [deps] cargo update
Updating cc                         v1.1.27 -> v1.1.28
Updating js-sys                     v0.3.70 -> v0.3.71
Updating proc-macro2                v1.0.86 -> v1.0.87
Updating wasm-bindgen-backend       v0.2.93 -> v0.2.94
Updating wasm-bindgen-macro-support v0.2.93 -> v0.2.94
Updating wasm-bindgen-macro         v0.2.93 -> v0.2.94
Updating wasm-bindgen-shared        v0.2.93 -> v0.2.94
Updating wasm-bindgen               v0.2.93 -> v0.2.94
2024-10-10 12:50:46 +02:00
2f496265af [release] logtimes v1.0.16 2024-10-06 08:57:42 +02:00
df42841fd1 [deps] cargo update
Updating autocfg   v1.3.0  -> v1.4.0
Updating cc        v1.1.21 -> v1.1.27
Updating once_cell v1.19.0 -> v1.20.2
Updating syn       v2.0.77 -> v2.0.79
2024-10-06 08:57:27 +02:00
9791354234 [release] logtimes v1.0.15 2024-09-25 23:07:09 +02:00
e85bb2298b [deps] cargo update
Updating libc v0.2.158 -> v0.2.159
2024-09-25 23:06:55 +02:00
95da70b177 [release] logtimes v1.0.14 2024-09-19 10:59:47 +02:00
9418cdaced [deps] cargo update
Updating cc             v1.1.18 -> v1.1.21
Updating iana-time-zone v0.1.60 -> v0.1.61
Updating unicode-ident  v1.0.12 -> v1.0.13
2024-09-19 10:59:35 +02:00
ab38176adb [release] logtimes v1.0.13 2024-09-09 11:19:59 +02:00
ce8ac3c7f2 [deps] cargo update
Updating cc v1.1.16 -> v1.1.18
2024-09-09 11:19:49 +02:00
a6d8eba632 [clippy] fix: byte array -> byte str 2024-09-09 11:19:02 +02:00
e5952d5467 [clippy] quirk in Cargo.toml for pedantic lint 2024-09-09 11:17:00 +02:00
90f1515166 [release] logtimes v1.0.12 2024-09-04 16:47:18 +02:00
fb4d9ee3f4 [chg] only 3 decimal places (save space) 2024-09-04 16:47:01 +02:00
2597cc87b8 [deps] cargo update
Updating cc v1.1.15 -> v1.1.16
2024-09-04 16:45:45 +02:00
fbcf7ea4c5 [release] logtimes v1.0.11 2024-09-03 21:01:42 +02:00
7b8f1cf81c [deps] cargo update
Updating cc    v1.1.11  -> v1.1.15
Updating libc  v0.2.155 -> v0.2.158
Updating quote v1.0.36  -> v1.0.37
Updating syn   v2.0.74  -> v2.0.77
2024-09-03 20:52:53 +02:00
3 changed files with 38 additions and 40 deletions

65
Cargo.lock generated
View File

@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo. # This file is automatically @generated by Cargo.
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 4
[[package]] [[package]]
name = "android-tzdata" name = "android-tzdata"
@ -19,9 +19,9 @@ dependencies = [
[[package]] [[package]]
name = "autocfg" name = "autocfg"
version = "1.3.0" version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]] [[package]]
name = "bumpalo" name = "bumpalo"
@ -31,9 +31,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.1.11" version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fb8dd288a69fc53a1996d7ecfbf4a20d59065bff137ce7e56bbd620de191189" checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc"
dependencies = [ dependencies = [
"shlex", "shlex",
] ]
@ -64,9 +64,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]] [[package]]
name = "iana-time-zone" name = "iana-time-zone"
version = "0.1.60" version = "0.1.61"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
dependencies = [ dependencies = [
"android_system_properties", "android_system_properties",
"core-foundation-sys", "core-foundation-sys",
@ -87,18 +87,19 @@ dependencies = [
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.70" version = "0.3.74"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705"
dependencies = [ dependencies = [
"once_cell",
"wasm-bindgen", "wasm-bindgen",
] ]
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.155" version = "0.2.167"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc"
[[package]] [[package]]
name = "log" name = "log"
@ -108,7 +109,7 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]] [[package]]
name = "logtimes" name = "logtimes"
version = "1.0.10" version = "1.0.25"
dependencies = [ dependencies = [
"chrono", "chrono",
] ]
@ -124,24 +125,24 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.19.0" version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.86" version = "1.0.92"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.36" version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
@ -154,9 +155,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.74" version = "2.0.90"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -165,15 +166,15 @@ dependencies = [
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.12" version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
[[package]] [[package]]
name = "wasm-bindgen" name = "wasm-bindgen"
version = "0.2.93" version = "0.2.97"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"once_cell", "once_cell",
@ -182,9 +183,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-backend" name = "wasm-bindgen-backend"
version = "0.2.93" version = "0.2.97"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd"
dependencies = [ dependencies = [
"bumpalo", "bumpalo",
"log", "log",
@ -197,9 +198,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.93" version = "0.2.97"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051"
dependencies = [ dependencies = [
"quote", "quote",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
@ -207,9 +208,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro-support" name = "wasm-bindgen-macro-support"
version = "0.2.93" version = "0.2.97"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -220,9 +221,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-shared" name = "wasm-bindgen-shared"
version = "0.2.93" version = "0.2.97"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49"
[[package]] [[package]]
name = "windows-core" name = "windows-core"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "logtimes" name = "logtimes"
version = "1.0.10" version = "1.0.25"
authors = ["Paul Schulze <p.schulze@avm.de>"] authors = ["Paul Schulze <p.schulze@avm.de>"]
edition = "2021" edition = "2021"
@ -13,7 +13,7 @@ features = ["std", "clock"]
unsafe_code = "forbid" unsafe_code = "forbid"
[lints.clippy] [lints.clippy]
pedantic = "warn" pedantic = { level = "warn", priority = -1 }
todo = "warn" todo = "warn"
unwrap_used = "warn" unwrap_used = "warn"
inline_always = "allow" inline_always = "allow"

View File

@ -6,11 +6,10 @@ use std::{
use chrono::prelude::*; use chrono::prelude::*;
const TIME_FORMAT: &str = "%H:%M:%S%.6f"; const TIME_FORMAT: &str = "%H:%M:%S%.3f";
type LogtimesResult = Result<(), IoError>; type LogtimesResult = Result<(), IoError>;
#[inline(always)]
fn print_time<T>(output: &mut T) -> LogtimesResult fn print_time<T>(output: &mut T) -> LogtimesResult
where where
T: Write, T: Write,
@ -20,7 +19,6 @@ where
write!(output, "[{}] ", &date_now) write!(output, "[{}] ", &date_now)
} }
#[inline(always)]
fn print_time_color<T>(output: &mut T) -> Result<(), std::io::Error> fn print_time_color<T>(output: &mut T) -> Result<(), std::io::Error>
where where
T: Write, T: Write,
@ -33,7 +31,6 @@ where
write!(output, "{}[{}]{} ", color_green, &date_now, color_off) write!(output, "{}[{}]{} ", color_green, &date_now, color_off)
} }
#[inline(always)]
fn print_delete_line<T>(output: &mut T) -> LogtimesResult fn print_delete_line<T>(output: &mut T) -> LogtimesResult
where where
T: Write, T: Write,
@ -89,13 +86,13 @@ fn run() -> LogtimesResult {
let end = trim_end(&linebuf); let end = trim_end(&linebuf);
out.write_all(&linebuf[..end])?; out.write_all(&linebuf[..end])?;
out.write_all(&[b'\r', b'\n'])?; out.write_all(b"\r\n")?;
out.flush()?; out.flush()?;
if let Some(ref mut f) = log_file { if let Some(ref mut f) = log_file {
print_time(f)?; print_time(f)?;
f.write_all(&linebuf[..end])?; f.write_all(&linebuf[..end])?;
f.write_all(&[b'\n'])?; f.write_all(b"\n")?;
f.flush()?; f.flush()?;
}; };