Compare commits
	
		
			47 Commits
		
	
	
		
			v1.0.5
			...
			eaf877f59c
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| eaf877f59c | |||
| b39aeb0df9 | |||
| 7b99e90663 | |||
| 9ea6a6e224 | |||
| 4fd4acec0e | |||
| 7bf1352738 | |||
| 7f0a8929fe | |||
| 6d776af6d1 | |||
| 098b7bbe26 | |||
| 57eed0f5ac | |||
| 896acd090f | |||
| 3e1d0d8bc7 | |||
| ef9706ec58 | |||
| bc536a3308 | |||
| e511fe2679 | |||
| 92e8b0f498 | |||
| af8642baaa | |||
| 1c973cc44e | |||
| ac388c8517 | |||
| 2f496265af | |||
| df42841fd1 | |||
| 9791354234 | |||
| e85bb2298b | |||
| 95da70b177 | |||
| 9418cdaced | |||
| ab38176adb | |||
| ce8ac3c7f2 | |||
| a6d8eba632 | |||
| e5952d5467 | |||
| 90f1515166 | |||
| fb4d9ee3f4 | |||
| 2597cc87b8 | |||
| fbcf7ea4c5 | |||
| 7b8f1cf81c | |||
| f2b0757a87 | |||
| 49762be53f | |||
| 43f9345ebc | |||
| cb33e3dce9 | |||
| 553f8679a3 | |||
| 27a67ad480 | |||
| aeb7c4fbff | |||
| a07f17f5f5 | |||
| f1bfeced19 | |||
| 1daa5d5304 | |||
| ae83358d14 | |||
| ed35f30f68 | |||
| 036d1658fb | 
							
								
								
									
										135
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										135
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							| @@ -1,6 +1,6 @@ | ||||
| # This file is automatically @generated by Cargo. | ||||
| # It is not intended for manual editing. | ||||
| version = 3 | ||||
| version = 4 | ||||
|  | ||||
| [[package]] | ||||
| name = "android-tzdata" | ||||
| @@ -19,23 +19,23 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "autocfg" | ||||
| version = "1.1.0" | ||||
| version = "1.4.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" | ||||
| checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" | ||||
|  | ||||
| [[package]] | ||||
| name = "bumpalo" | ||||
| version = "3.14.0" | ||||
| version = "3.16.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" | ||||
| checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" | ||||
|  | ||||
| [[package]] | ||||
| name = "cc" | ||||
| version = "1.0.83" | ||||
| version = "1.2.2" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" | ||||
| checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" | ||||
| dependencies = [ | ||||
|  "libc", | ||||
|  "shlex", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| @@ -46,9 +46,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" | ||||
|  | ||||
| [[package]] | ||||
| name = "chrono" | ||||
| version = "0.4.33" | ||||
| version = "0.4.38" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" | ||||
| checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" | ||||
| dependencies = [ | ||||
|  "android-tzdata", | ||||
|  "iana-time-zone", | ||||
| @@ -58,15 +58,15 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "core-foundation-sys" | ||||
| version = "0.8.6" | ||||
| version = "0.8.7" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" | ||||
| checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" | ||||
|  | ||||
| [[package]] | ||||
| name = "iana-time-zone" | ||||
| version = "0.1.60" | ||||
| version = "0.1.61" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" | ||||
| checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" | ||||
| dependencies = [ | ||||
|  "android_system_properties", | ||||
|  "core-foundation-sys", | ||||
| @@ -87,70 +87,77 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "js-sys" | ||||
| version = "0.3.68" | ||||
| version = "0.3.74" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" | ||||
| checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" | ||||
| dependencies = [ | ||||
|  "once_cell", | ||||
|  "wasm-bindgen", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| name = "libc" | ||||
| version = "0.2.153" | ||||
| version = "0.2.167" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" | ||||
| checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" | ||||
|  | ||||
| [[package]] | ||||
| name = "log" | ||||
| version = "0.4.20" | ||||
| version = "0.4.22" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" | ||||
| checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" | ||||
|  | ||||
| [[package]] | ||||
| name = "logtimes" | ||||
| version = "1.0.5" | ||||
| version = "1.0.25" | ||||
| dependencies = [ | ||||
|  "chrono", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| name = "num-traits" | ||||
| version = "0.2.18" | ||||
| version = "0.2.19" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" | ||||
| checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" | ||||
| dependencies = [ | ||||
|  "autocfg", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| name = "once_cell" | ||||
| version = "1.19.0" | ||||
| version = "1.20.2" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" | ||||
| checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" | ||||
|  | ||||
| [[package]] | ||||
| name = "proc-macro2" | ||||
| version = "1.0.78" | ||||
| version = "1.0.92" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" | ||||
| checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" | ||||
| dependencies = [ | ||||
|  "unicode-ident", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| name = "quote" | ||||
| version = "1.0.35" | ||||
| version = "1.0.37" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" | ||||
| checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" | ||||
| dependencies = [ | ||||
|  "proc-macro2", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| name = "syn" | ||||
| version = "2.0.48" | ||||
| name = "shlex" | ||||
| version = "1.3.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" | ||||
| checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" | ||||
|  | ||||
| [[package]] | ||||
| name = "syn" | ||||
| version = "2.0.90" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" | ||||
| dependencies = [ | ||||
|  "proc-macro2", | ||||
|  "quote", | ||||
| @@ -159,25 +166,26 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "unicode-ident" | ||||
| version = "1.0.12" | ||||
| version = "1.0.14" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" | ||||
| checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" | ||||
|  | ||||
| [[package]] | ||||
| name = "wasm-bindgen" | ||||
| version = "0.2.91" | ||||
| version = "0.2.97" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" | ||||
| checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" | ||||
| dependencies = [ | ||||
|  "cfg-if", | ||||
|  "once_cell", | ||||
|  "wasm-bindgen-macro", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| name = "wasm-bindgen-backend" | ||||
| version = "0.2.91" | ||||
| version = "0.2.97" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" | ||||
| checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" | ||||
| dependencies = [ | ||||
|  "bumpalo", | ||||
|  "log", | ||||
| @@ -190,9 +198,9 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "wasm-bindgen-macro" | ||||
| version = "0.2.91" | ||||
| version = "0.2.97" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" | ||||
| checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" | ||||
| dependencies = [ | ||||
|  "quote", | ||||
|  "wasm-bindgen-macro-support", | ||||
| @@ -200,9 +208,9 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "wasm-bindgen-macro-support" | ||||
| version = "0.2.91" | ||||
| version = "0.2.97" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" | ||||
| checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" | ||||
| dependencies = [ | ||||
|  "proc-macro2", | ||||
|  "quote", | ||||
| @@ -213,9 +221,9 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "wasm-bindgen-shared" | ||||
| version = "0.2.91" | ||||
| version = "0.2.97" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" | ||||
| checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" | ||||
|  | ||||
| [[package]] | ||||
| name = "windows-core" | ||||
| @@ -228,13 +236,14 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "windows-targets" | ||||
| version = "0.52.0" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" | ||||
| checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" | ||||
| dependencies = [ | ||||
|  "windows_aarch64_gnullvm", | ||||
|  "windows_aarch64_msvc", | ||||
|  "windows_i686_gnu", | ||||
|  "windows_i686_gnullvm", | ||||
|  "windows_i686_msvc", | ||||
|  "windows_x86_64_gnu", | ||||
|  "windows_x86_64_gnullvm", | ||||
| @@ -243,42 +252,48 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "windows_aarch64_gnullvm" | ||||
| version = "0.52.0" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" | ||||
| checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" | ||||
|  | ||||
| [[package]] | ||||
| name = "windows_aarch64_msvc" | ||||
| version = "0.52.0" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" | ||||
| checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" | ||||
|  | ||||
| [[package]] | ||||
| name = "windows_i686_gnu" | ||||
| version = "0.52.0" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" | ||||
| checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" | ||||
|  | ||||
| [[package]] | ||||
| name = "windows_i686_gnullvm" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" | ||||
|  | ||||
| [[package]] | ||||
| name = "windows_i686_msvc" | ||||
| version = "0.52.0" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" | ||||
| checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" | ||||
|  | ||||
| [[package]] | ||||
| name = "windows_x86_64_gnu" | ||||
| version = "0.52.0" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" | ||||
| checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" | ||||
|  | ||||
| [[package]] | ||||
| name = "windows_x86_64_gnullvm" | ||||
| version = "0.52.0" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" | ||||
| checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" | ||||
|  | ||||
| [[package]] | ||||
| name = "windows_x86_64_msvc" | ||||
| version = "0.52.0" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" | ||||
| checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| [package] | ||||
| name = "logtimes" | ||||
| version = "1.0.5" | ||||
| version = "1.0.25" | ||||
| authors = ["Paul Schulze <p.schulze@avm.de>"] | ||||
| edition = "2021" | ||||
|  | ||||
| @@ -13,7 +13,7 @@ features = ["std", "clock"] | ||||
| unsafe_code = "forbid" | ||||
|  | ||||
| [lints.clippy] | ||||
| pedantic = "warn" | ||||
| pedantic = { level = "warn", priority = -1 } | ||||
| todo = "warn" | ||||
| unwrap_used = "warn" | ||||
| inline_always = "allow" | ||||
|   | ||||
							
								
								
									
										19
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								src/main.rs
									
									
									
									
									
								
							| @@ -6,11 +6,10 @@ use std::{ | ||||
|  | ||||
| use chrono::prelude::*; | ||||
|  | ||||
| const TIME_FORMAT: &str = "%H:%M:%S%.6f"; | ||||
| const TIME_FORMAT: &str = "%H:%M:%S%.3f"; | ||||
|  | ||||
| type LogtimesResult = Result<(), IoError>; | ||||
|  | ||||
| #[inline(always)] | ||||
| fn print_time<T>(output: &mut T) -> LogtimesResult | ||||
| where | ||||
|     T: Write, | ||||
| @@ -20,7 +19,6 @@ where | ||||
|     write!(output, "[{}] ", &date_now) | ||||
| } | ||||
|  | ||||
| #[inline(always)] | ||||
| fn print_time_color<T>(output: &mut T) -> Result<(), std::io::Error> | ||||
| where | ||||
|     T: Write, | ||||
| @@ -33,7 +31,6 @@ where | ||||
|     write!(output, "{}[{}]{} ", color_green, &date_now, color_off) | ||||
| } | ||||
|  | ||||
| #[inline(always)] | ||||
| fn print_delete_line<T>(output: &mut T) -> LogtimesResult | ||||
| where | ||||
|     T: Write, | ||||
| @@ -45,12 +42,10 @@ where | ||||
|  | ||||
| fn trim_end(line: &[u8]) -> usize { | ||||
|     let mut end = line.len(); | ||||
|     for ch in line.iter().rev() { | ||||
|         if *ch != b'\r' && *ch != b'\n' && *ch != b'\t' { | ||||
|             break; | ||||
|         } | ||||
|         end -= 1; | ||||
|     } | ||||
|     line.iter() | ||||
|         .rev() | ||||
|         .take_while(|ch| ch.is_ascii_whitespace()) | ||||
|         .for_each(|_| end -= 1); | ||||
|     end | ||||
| } | ||||
|  | ||||
| @@ -91,13 +86,13 @@ fn run() -> LogtimesResult { | ||||
|  | ||||
|             let end = trim_end(&linebuf); | ||||
|             out.write_all(&linebuf[..end])?; | ||||
|             out.write_all(&[b'\r', b'\n'])?; | ||||
|             out.write_all(b"\r\n")?; | ||||
|             out.flush()?; | ||||
|  | ||||
|             if let Some(ref mut f) = log_file { | ||||
|                 print_time(f)?; | ||||
|                 f.write_all(&linebuf[..end])?; | ||||
|                 f.write_all(&[b'\n'])?; | ||||
|                 f.write_all(b"\n")?; | ||||
|                 f.flush()?; | ||||
|             }; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user