Compare commits
	
		
			57 Commits
		
	
	
		
			v1.0.2
			...
			7b99e90663
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | |||
| 9d0c7928bf | |||
| d3fef99e54 | |||
| 855f4cd8c8 | |||
| b285f9bc53 | |||
| 0cb806c929 | |||
| 1251ef7642 | |||
| d86196d946 | |||
| a2aebd065c | |||
| 91a750d9ac | |||
| c13ec22021 | |||
| 3757b01295 | |||
| b47629cd86 | 
							
								
								
									
										138
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										138
									
								
								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.1" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" | ||||
| checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" | ||||
| dependencies = [ | ||||
|  "libc", | ||||
|  "shlex", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| @@ -46,9 +46,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" | ||||
|  | ||||
| [[package]] | ||||
| name = "chrono" | ||||
| version = "0.4.31" | ||||
| version = "0.4.38" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" | ||||
| checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" | ||||
| dependencies = [ | ||||
|  "android-tzdata", | ||||
|  "iana-time-zone", | ||||
| @@ -58,15 +58,15 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "core-foundation-sys" | ||||
| version = "0.8.4" | ||||
| version = "0.8.7" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" | ||||
| checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" | ||||
|  | ||||
| [[package]] | ||||
| name = "iana-time-zone" | ||||
| version = "0.1.58" | ||||
| version = "0.1.61" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" | ||||
| checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" | ||||
| dependencies = [ | ||||
|  "android_system_properties", | ||||
|  "core-foundation-sys", | ||||
| @@ -87,70 +87,76 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "js-sys" | ||||
| version = "0.3.64" | ||||
| version = "0.3.72" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" | ||||
| checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" | ||||
| dependencies = [ | ||||
|  "wasm-bindgen", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| name = "libc" | ||||
| version = "0.2.149" | ||||
| version = "0.2.166" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" | ||||
| checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" | ||||
|  | ||||
| [[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.2" | ||||
| version = "1.0.24" | ||||
| dependencies = [ | ||||
|  "chrono", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| name = "num-traits" | ||||
| version = "0.2.17" | ||||
| version = "0.2.19" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" | ||||
| checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" | ||||
| dependencies = [ | ||||
|  "autocfg", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| name = "once_cell" | ||||
| version = "1.18.0" | ||||
| version = "1.20.2" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" | ||||
| checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" | ||||
|  | ||||
| [[package]] | ||||
| name = "proc-macro2" | ||||
| version = "1.0.69" | ||||
| version = "1.0.92" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" | ||||
| checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" | ||||
| dependencies = [ | ||||
|  "unicode-ident", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| name = "quote" | ||||
| version = "1.0.33" | ||||
| version = "1.0.37" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" | ||||
| checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" | ||||
| dependencies = [ | ||||
|  "proc-macro2", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| name = "syn" | ||||
| version = "2.0.38" | ||||
| name = "shlex" | ||||
| version = "1.3.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" | ||||
| checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" | ||||
|  | ||||
| [[package]] | ||||
| name = "syn" | ||||
| version = "2.0.89" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" | ||||
| dependencies = [ | ||||
|  "proc-macro2", | ||||
|  "quote", | ||||
| @@ -159,25 +165,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.87" | ||||
| version = "0.2.95" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" | ||||
| checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" | ||||
| dependencies = [ | ||||
|  "cfg-if", | ||||
|  "once_cell", | ||||
|  "wasm-bindgen-macro", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| name = "wasm-bindgen-backend" | ||||
| version = "0.2.87" | ||||
| version = "0.2.95" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" | ||||
| checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" | ||||
| dependencies = [ | ||||
|  "bumpalo", | ||||
|  "log", | ||||
| @@ -190,9 +197,9 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "wasm-bindgen-macro" | ||||
| version = "0.2.87" | ||||
| version = "0.2.95" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" | ||||
| checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" | ||||
| dependencies = [ | ||||
|  "quote", | ||||
|  "wasm-bindgen-macro-support", | ||||
| @@ -200,9 +207,9 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "wasm-bindgen-macro-support" | ||||
| version = "0.2.87" | ||||
| version = "0.2.95" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" | ||||
| checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" | ||||
| dependencies = [ | ||||
|  "proc-macro2", | ||||
|  "quote", | ||||
| @@ -213,28 +220,29 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "wasm-bindgen-shared" | ||||
| version = "0.2.87" | ||||
| version = "0.2.95" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" | ||||
| checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" | ||||
|  | ||||
| [[package]] | ||||
| name = "windows-core" | ||||
| version = "0.51.1" | ||||
| version = "0.52.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" | ||||
| checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" | ||||
| dependencies = [ | ||||
|  "windows-targets", | ||||
| ] | ||||
|  | ||||
| [[package]] | ||||
| name = "windows-targets" | ||||
| version = "0.48.5" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" | ||||
| 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 +251,48 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "windows_aarch64_gnullvm" | ||||
| version = "0.48.5" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" | ||||
| checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" | ||||
|  | ||||
| [[package]] | ||||
| name = "windows_aarch64_msvc" | ||||
| version = "0.48.5" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" | ||||
| checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" | ||||
|  | ||||
| [[package]] | ||||
| name = "windows_i686_gnu" | ||||
| version = "0.48.5" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" | ||||
| 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.48.5" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" | ||||
| checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" | ||||
|  | ||||
| [[package]] | ||||
| name = "windows_x86_64_gnu" | ||||
| version = "0.48.5" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" | ||||
| checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" | ||||
|  | ||||
| [[package]] | ||||
| name = "windows_x86_64_gnullvm" | ||||
| version = "0.48.5" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" | ||||
| checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" | ||||
|  | ||||
| [[package]] | ||||
| name = "windows_x86_64_msvc" | ||||
| version = "0.48.5" | ||||
| version = "0.52.6" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" | ||||
| checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" | ||||
|   | ||||
							
								
								
									
										11
									
								
								Cargo.toml
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								Cargo.toml
									
									
									
									
									
								
							| @@ -1,6 +1,6 @@ | ||||
| [package] | ||||
| name = "logtimes" | ||||
| version = "1.0.2" | ||||
| version = "1.0.24" | ||||
| authors = ["Paul Schulze <p.schulze@avm.de>"] | ||||
| edition = "2021" | ||||
|  | ||||
| @@ -9,6 +9,15 @@ version = "0.4" | ||||
| default-features = false | ||||
| features = ["std", "clock"] | ||||
|  | ||||
| [lints.rust] | ||||
| unsafe_code = "forbid" | ||||
|  | ||||
| [lints.clippy] | ||||
| pedantic = { level = "warn", priority = -1 } | ||||
| todo = "warn" | ||||
| unwrap_used = "warn" | ||||
| inline_always = "allow" | ||||
|  | ||||
| [profile.release] | ||||
| lto = true | ||||
| debug = false | ||||
|   | ||||
							
								
								
									
										26
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								src/main.rs
									
									
									
									
									
								
							| @@ -1,8 +1,3 @@ | ||||
| #![warn(clippy::pedantic)] | ||||
| #![warn(clippy::todo)] | ||||
| #![warn(clippy::unwrap_used)] | ||||
| #![allow(clippy::inline_always)] | ||||
|  | ||||
| use std::{ | ||||
|     env::args, | ||||
|     fs::File, | ||||
| @@ -11,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, | ||||
| @@ -25,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, | ||||
| @@ -38,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, | ||||
| @@ -50,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 | ||||
| } | ||||
|  | ||||
| @@ -96,17 +86,17 @@ 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()?; | ||||
|             }; | ||||
|  | ||||
|             // clear line buffer so it is fresh for the next line | ||||
|             // clear line buffer, so it is fresh for the next line | ||||
|             linebuf.clear(); | ||||
|             continue; | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user