diff options
Diffstat (limited to 'vendor/tracing-tree')
21 files changed, 0 insertions, 2896 deletions
diff --git a/vendor/tracing-tree/.cargo-checksum.json b/vendor/tracing-tree/.cargo-checksum.json deleted file mode 100644 index 312175066..000000000 --- a/vendor/tracing-tree/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"Cargo.lock":"4046f9989c418b810f9bd43999016c13754aaa1f15b10b439db5bc7ab62c00d2","Cargo.toml":"33995653f5d0f203eaa4016d136103f4e2b062dac8d5b4abfc5d03857a82ace6","LICENSE-APACHE":"c9c77d27bd737506eee1be90c11885fad935695714eafacd6725f41fff9ec8da","LICENSE-MIT":"d31139de68f7e19f9b32cd7de53dbb125b3c68522bbbb1d0c186c33112d34466","README.md":"8337ed6c0cfe5e45bd25e5ecdf3acbd65fc1f406a35813ec62157e1e470bb0fe","examples/basic.rs":"41ff42bbfa65ba1676f0b09f79d2e6a43c3510ad87944c15da10bfe8faa4ec42","examples/basic.stdout":"093ccbe085637c649b91b11c936135396047ec6209bb60a0f2d0895c94b8177e","examples/no-indent.rs":"67c00ef7ca4d30f753e3a5c05ae98051f845faadc4133ff2fcda834843786c4d","examples/no-indent.stdout":"a21ae7c7f1285fdcf478b6d1a4f24fc5aae79018fb451295dac8bc31378eb7fe","examples/quiet.rs":"65a4cbb650cea4939ed274c2fd4d50c953151716fa6564b23393e1df6fb7afd7","examples/quiet.stdout":"88f5f3e1b2366ae29c3d44e2cfd2f2b58814590830d06f41bd1616c11a4cde6c","examples/stderr.rs":"ce0896f50be810908fb7083661bf39da6c9733ddef9188d40499313a40fe2c7a","examples/stderr.stderr":"8ffaa4accbfc375538179880014c4155d1c48a73ecc14d04060a31efa2273d1d","examples/wraparound.rs":"7998f2e7b9e1f0dfc4b0cf11b1cdcf0f44c85aeaabbea9749113584ac7a3879f","examples/wraparound.stdout":"3e8872a6de0fc259393d0363737d20e4e6f7c7bacad1d46a3a9e7ac55e24d5df","src/format.rs":"18f8a09d1cf3c5123c2a14648b8be77fde37f6bdc773b74195bcf1f2b35f3d19","src/lib.rs":"420140999824780eb3e09fee948612087abd1915a4bdb9d60f49d7068a6af85b","src/time.rs":"af57c283b55cb84f1b4b3bdf1eb352fbcfd1d2492d65bec5bb5041bd6d12b1b0","tests/format_time.rs":"f119c668d01fca745acdf0fcc938ecc137c9c79b7fa72c668c006f509fef0db8","tests/ui.rs":"c73e2a08c4a6f5825af460842af3b83701d1008bddbf720df78b57675e082c77"},"package":"92d6b63348fad3ae0439b8bebf8d38fb5bda0b115d7a8a7e6f165f12790c58c3"}
\ No newline at end of file diff --git a/vendor/tracing-tree/Cargo.lock b/vendor/tracing-tree/Cargo.lock deleted file mode 100644 index 8c74bbe8d..000000000 --- a/vendor/tracing-tree/Cargo.lock +++ /dev/null @@ -1,891 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - -[[package]] -name = "backtrace" -version = "0.3.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bstr" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09" -dependencies = [ - "memchr", - "once_cell", - "regex-automata", - "serde", -] - -[[package]] -name = "camino" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cc" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "color-eyre" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a667583cca8c4f8436db8de46ea8233c42a7d9ae424a82d338f2e4675229204" -dependencies = [ - "backtrace", - "color-spantrace", - "eyre", - "indenter", - "once_cell", - "owo-colors", - "tracing-error", -] - -[[package]] -name = "color-spantrace" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba75b3d9449ecdccb27ecbc479fdc0b87fa2dd43d2f8298f9bf0e59aacc8dce" -dependencies = [ - "once_cell", - "owo-colors", - "tracing-core", - "tracing-error", -] - -[[package]] -name = "colored" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" -dependencies = [ - "atty", - "lazy_static", - "winapi", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "eyre" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" -dependencies = [ - "indenter", - "once_cell", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "gimli" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" - -[[package]] -name = "indenter" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" -dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "is-terminal" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" -dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix", - "windows-sys 0.48.0", -] - -[[package]] -name = "itoa" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.141" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" - -[[package]] -name = "linux-raw-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b085a4f2cde5781fc4b1717f2e86c62f5cda49de7ba99a7c2eae02b61c9064c" - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "miniz_oxide" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" -dependencies = [ - "adler", -] - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - -[[package]] -name = "object" -version = "0.30.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "owo-colors" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "proc-macro2" -version = "1.0.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustfix" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd2853d9e26988467753bd9912c3a126f642d05d229a4b53f5752ee36c56481" -dependencies = [ - "anyhow", - "log", - "serde", - "serde_json", -] - -[[package]] -name = "rustix" -version = "0.37.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79bef90eb6d984c72722595b5b1348ab39275a5e5123faca6863bf07d75a4e0" -dependencies = [ - "bitflags", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys", - "windows-sys 0.48.0", -] - -[[package]] -name = "ryu" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" - -[[package]] -name = "semver" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.160" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.160" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.15", -] - -[[package]] -name = "serde_json" -version = "1.0.96" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sharded-slab" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys 0.45.0", -] - -[[package]] -name = "thiserror" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.15", -] - -[[package]] -name = "thread_local" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" -dependencies = [ - "itoa", - "libc", - "num_threads", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" - -[[package]] -name = "time-macros" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" -dependencies = [ - "time-core", -] - -[[package]] -name = "tracing" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "tracing-core" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-error" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" -dependencies = [ - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "tracing-log" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" -dependencies = [ - "lazy_static", - "log", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "tracing-tree" -version = "0.2.4" -dependencies = [ - "is-terminal", - "log", - "nu-ansi-term", - "time", - "tracing", - "tracing-core", - "tracing-log", - "tracing-subscriber", - "ui_test", -] - -[[package]] -name = "ui_test" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5b4baac6b9b74d53ea224bc6dd7ed7276a7fb6785145ba7cfa96c01b63f4cb" -dependencies = [ - "bstr", - "cargo-platform", - "cargo_metadata", - "color-eyre", - "colored", - "crossbeam-channel", - "diff", - "lazy_static", - "regex", - "rustc_version", - "rustfix", - "serde", - "serde_json", - "tempfile", -] - -[[package]] -name = "unicode-ident" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.0", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" -dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" diff --git a/vendor/tracing-tree/Cargo.toml b/vendor/tracing-tree/Cargo.toml deleted file mode 100644 index 7d1ffe93a..000000000 --- a/vendor/tracing-tree/Cargo.toml +++ /dev/null @@ -1,69 +0,0 @@ -# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO -# -# When uploading crates to the registry Cargo will automatically -# "normalize" Cargo.toml files for maximal compatibility -# with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies. -# -# If you are reading this file be aware that the original Cargo.toml -# will likely look very different (and much more reasonable). -# See Cargo.toml.orig for the original contents. - -[package] -edition = "2018" -name = "tracing-tree" -version = "0.2.4" -authors = [ - "David Barsky <me@davidbarsky.com>", - "Nathan Whitaker", -] -description = "A Tracing Layer which prints a tree of spans and events." -readme = "README.md" -license = "MIT OR Apache-2.0" -repository = "https://github.com/davidbarsky/tracing-tree" - -[[test]] -name = "ui" -harness = false - -[dependencies.is-terminal] -version = "0.4.7" - -[dependencies.nu-ansi-term] -version = "0.46.0" - -[dependencies.time] -version = "0.3.20" -features = [ - "formatting", - "local-offset", -] -optional = true - -[dependencies.tracing-core] -version = "0.1" - -[dependencies.tracing-log] -version = "0.1" -optional = true - -[dependencies.tracing-subscriber] -version = "0.3" -features = [ - "registry", - "fmt", - "std", -] -default-features = false - -[dev-dependencies.log] -version = "0.4" - -[dev-dependencies.tracing] -version = "0.1" - -[dev-dependencies.ui_test] -version = "0.7" - -[features] -default = ["tracing-log"] diff --git a/vendor/tracing-tree/LICENSE-APACHE b/vendor/tracing-tree/LICENSE-APACHE deleted file mode 100644 index cb38739ee..000000000 --- a/vendor/tracing-tree/LICENSE-APACHE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2021 tracing-tree contributors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/tracing-tree/LICENSE-MIT b/vendor/tracing-tree/LICENSE-MIT deleted file mode 100644 index d0afab4a5..000000000 --- a/vendor/tracing-tree/LICENSE-MIT +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 tracing-tree contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/tracing-tree/README.md b/vendor/tracing-tree/README.md deleted file mode 100644 index 01c3b1c78..000000000 --- a/vendor/tracing-tree/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# tracing-tree - -Instrument your application with [tracing](https://github.com/tokio-rs/tracing) -and get tree-structured summaries of your application activity with timing -information on the console: - -https://github.com/davidbarsky/tracing-tree/blob/483cc0a118c3170f4246d6fa4a9f018a00d8f0a9/examples/quiet.stdout#L1-L28 - -(Format inspired by [slog-term](https://github.com/slog-rs/slog#terminal-output-example)) - -## Setup - -After instrumenting your app with -[tracing](https://github.com/tokio-rs/tracing), add this subscriber like this: - -```rust -let subscriber = Registry::default().with(HierarchicalLayer::new(2)); -tracing::subscriber::set_global_default(subscriber).unwrap(); -```
\ No newline at end of file diff --git a/vendor/tracing-tree/examples/basic.rs b/vendor/tracing-tree/examples/basic.rs deleted file mode 100644 index a736c6524..000000000 --- a/vendor/tracing-tree/examples/basic.rs +++ /dev/null @@ -1,83 +0,0 @@ -use tracing::{debug, error, info, instrument, span, warn, Level}; -use tracing_subscriber::{layer::SubscriberExt, registry::Registry}; -use tracing_tree::HierarchicalLayer; - -fn main() { - let layer = HierarchicalLayer::default() - .with_writer(std::io::stdout) - .with_indent_lines(true) - .with_indent_amount(2) - .with_thread_names(true) - .with_thread_ids(true) - .with_verbose_exit(true) - .with_verbose_entry(true) - .with_targets(true); - - let subscriber = Registry::default().with(layer); - tracing::subscriber::set_global_default(subscriber).unwrap(); - #[cfg(feature = "tracing-log")] - tracing_log::LogTracer::init().unwrap(); - - let app_span = span!(Level::TRACE, "hierarchical-example", version = %0.1); - let _e = app_span.enter(); - - let server_span = span!(Level::TRACE, "server", host = "localhost", port = 8080); - let _e2 = server_span.enter(); - info!("starting"); - std::thread::sleep(std::time::Duration::from_millis(3000)); - info!("listening"); - let peer1 = span!(Level::TRACE, "conn", peer_addr = "82.9.9.9", port = 42381); - peer1.in_scope(|| { - debug!("connected"); - std::thread::sleep(std::time::Duration::from_millis(300)); - debug!(length = 2, "message received"); - }); - drop(peer1); - let peer2 = span!(Level::TRACE, "conn", peer_addr = "8.8.8.8", port = 18230); - peer2.in_scope(|| { - std::thread::sleep(std::time::Duration::from_millis(300)); - debug!("connected"); - }); - drop(peer2); - let peer3 = span!( - Level::TRACE, - "foomp", - normal_var = 43, - "{} <- format string", - 42 - ); - peer3.in_scope(|| { - error!("hello"); - }); - drop(peer3); - let peer1 = span!(Level::TRACE, "conn", peer_addr = "82.9.9.9", port = 42381); - peer1.in_scope(|| { - warn!(algo = "xor", "weak encryption requested"); - std::thread::sleep(std::time::Duration::from_millis(300)); - debug!(length = 8, "response sent"); - debug!("disconnected"); - }); - drop(peer1); - let peer2 = span!(Level::TRACE, "conn", peer_addr = "8.8.8.8", port = 18230); - peer2.in_scope(|| { - debug!(length = 5, "message received"); - std::thread::sleep(std::time::Duration::from_millis(300)); - debug!(length = 8, "response sent"); - debug!("disconnected"); - }); - drop(peer2); - warn!("internal error"); - log::error!("this is a log message"); - info!("exit"); -} - -#[instrument] -fn call_a(name: &str) { - info!(name, "got a name"); - call_b(name) -} - -#[instrument] -fn call_b(name: &str) { - info!(name, "got a name"); -} diff --git a/vendor/tracing-tree/examples/basic.stdout b/vendor/tracing-tree/examples/basic.stdout deleted file mode 100644 index e1d7bb334..000000000 --- a/vendor/tracing-tree/examples/basic.stdout +++ /dev/null @@ -1,41 +0,0 @@ -1:main┐basic::hierarchical-example version=0.1 -1:main├┐basic::hierarchical-example version=0.1 -1:main│└┐basic::server host="localhost", port=8080 -1:main│ ├─ Xms INFO basic starting -1:main│ ├─ Xs INFO basic listening -1:main│ ├┐basic::server host="localhost", port=8080 -1:main│ │└┐basic::conn peer_addr="82.9.9.9", port=42381 -1:main│ │ ├─ Xms DEBUG basic connected -1:main│ │ ├─ Xms DEBUG basic message received, length=2 -1:main│ │┌┘basic::conn peer_addr="82.9.9.9", port=42381 -1:main│ ├┘basic::server host="localhost", port=8080 -1:main│ ├┐basic::server host="localhost", port=8080 -1:main│ │└┐basic::conn peer_addr="8.8.8.8", port=18230 -1:main│ │ ├─ Xms DEBUG basic connected -1:main│ │┌┘basic::conn peer_addr="8.8.8.8", port=18230 -1:main│ ├┘basic::server host="localhost", port=8080 -1:main│ ├┐basic::server host="localhost", port=8080 -1:main│ │└┐basic::foomp 42 <- format string, normal_var=43 -1:main│ │ ├─ Xms ERROR basic hello -1:main│ │┌┘basic::foomp 42 <- format string, normal_var=43 -1:main│ ├┘basic::server host="localhost", port=8080 -1:main│ ├┐basic::server host="localhost", port=8080 -1:main│ │└┐basic::conn peer_addr="82.9.9.9", port=42381 -1:main│ │ ├─ Xms WARN basic weak encryption requested, algo="xor" -1:main│ │ ├─ Xms DEBUG basic response sent, length=8 -1:main│ │ ├─ Xms DEBUG basic disconnected -1:main│ │┌┘basic::conn peer_addr="82.9.9.9", port=42381 -1:main│ ├┘basic::server host="localhost", port=8080 -1:main│ ├┐basic::server host="localhost", port=8080 -1:main│ │└┐basic::conn peer_addr="8.8.8.8", port=18230 -1:main│ │ ├─ Xms DEBUG basic message received, length=5 -1:main│ │ ├─ Xms DEBUG basic response sent, length=8 -1:main│ │ ├─ Xms DEBUG basic disconnected -1:main│ │┌┘basic::conn peer_addr="8.8.8.8", port=18230 -1:main│ ├┘basic::server host="localhost", port=8080 -1:main│ ├─ Xs WARN basic internal error -1:main│ ├─ Xs ERROR basic this is a log message -1:main│ ├─ Xs INFO basic exit -1:main│┌┘basic::server host="localhost", port=8080 -1:main├┘basic::hierarchical-example version=0.1 -1:main┘basic::hierarchical-example version=0.1 diff --git a/vendor/tracing-tree/examples/no-indent.rs b/vendor/tracing-tree/examples/no-indent.rs deleted file mode 100644 index 288e560fa..000000000 --- a/vendor/tracing-tree/examples/no-indent.rs +++ /dev/null @@ -1,79 +0,0 @@ -use tracing::{debug, error, info, instrument, span, warn, Level}; -use tracing_subscriber::{layer::SubscriberExt, registry::Registry}; -use tracing_tree::HierarchicalLayer; - -fn main() { - let layer = HierarchicalLayer::default() - .with_writer(std::io::stdout) - .with_indent_amount(2) - .with_thread_names(true) - .with_thread_ids(true) - .with_verbose_exit(false) - .with_verbose_entry(false) - .with_targets(true); - - let subscriber = Registry::default().with(layer); - tracing::subscriber::set_global_default(subscriber).unwrap(); - - let app_span = span!(Level::TRACE, "hierarchical-example", version = %0.1); - let _e = app_span.enter(); - - let server_span = span!(Level::TRACE, "server", host = "localhost", port = 8080); - let _e2 = server_span.enter(); - info!("starting"); - std::thread::sleep(std::time::Duration::from_millis(300)); - info!("listening"); - let peer1 = span!(Level::TRACE, "conn", peer_addr = "82.9.9.9", port = 42381); - peer1.in_scope(|| { - debug!("connected"); - std::thread::sleep(std::time::Duration::from_millis(300)); - debug!(length = 2, "message received"); - }); - drop(peer1); - let peer2 = span!(Level::TRACE, "conn", peer_addr = "8.8.8.8", port = 18230); - peer2.in_scope(|| { - std::thread::sleep(std::time::Duration::from_millis(300)); - debug!("connected"); - }); - drop(peer2); - let peer3 = span!( - Level::TRACE, - "foomp", - normal_var = 43, - "{} <- format string", - 42 - ); - peer3.in_scope(|| { - error!("hello"); - }); - drop(peer3); - let peer1 = span!(Level::TRACE, "conn", peer_addr = "82.9.9.9", port = 42381); - peer1.in_scope(|| { - warn!(algo = "xor", "weak encryption requested"); - std::thread::sleep(std::time::Duration::from_millis(300)); - debug!(length = 8, "response sent"); - debug!("disconnected"); - }); - drop(peer1); - let peer2 = span!(Level::TRACE, "conn", peer_addr = "8.8.8.8", port = 18230); - peer2.in_scope(|| { - debug!(length = 5, "message received"); - std::thread::sleep(std::time::Duration::from_millis(300)); - debug!(length = 8, "response sent"); - debug!("disconnected"); - }); - drop(peer2); - warn!("internal error"); - info!("exit"); -} - -#[instrument] -fn call_a(name: &str) { - info!(name, "got a name"); - call_b(name) -} - -#[instrument] -fn call_b(name: &str) { - info!(name, "got a name"); -} diff --git a/vendor/tracing-tree/examples/no-indent.stdout b/vendor/tracing-tree/examples/no-indent.stdout deleted file mode 100644 index 1339211f1..000000000 --- a/vendor/tracing-tree/examples/no-indent.stdout +++ /dev/null @@ -1,21 +0,0 @@ -1:main no_indent::hierarchical-example version=0.1 -1:main no_indent::server host="localhost", port=8080 -1:main Xms INFO no_indent starting -1:main Xms INFO no_indent listening -1:main no_indent::conn peer_addr="82.9.9.9", port=42381 -1:main Xms DEBUG no_indent connected -1:main Xms DEBUG no_indent message received, length=2 -1:main no_indent::conn peer_addr="8.8.8.8", port=18230 -1:main Xms DEBUG no_indent connected -1:main no_indent::foomp 42 <- format string, normal_var=43 -1:main Xms ERROR no_indent hello -1:main no_indent::conn peer_addr="82.9.9.9", port=42381 -1:main Xms WARN no_indent weak encryption requested, algo="xor" -1:main Xms DEBUG no_indent response sent, length=8 -1:main Xms DEBUG no_indent disconnected -1:main no_indent::conn peer_addr="8.8.8.8", port=18230 -1:main Xms DEBUG no_indent message received, length=5 -1:main Xms DEBUG no_indent response sent, length=8 -1:main Xms DEBUG no_indent disconnected -1:main Xs WARN no_indent internal error -1:main Xs INFO no_indent exit diff --git a/vendor/tracing-tree/examples/quiet.rs b/vendor/tracing-tree/examples/quiet.rs deleted file mode 100644 index 81b0c9c2f..000000000 --- a/vendor/tracing-tree/examples/quiet.rs +++ /dev/null @@ -1,80 +0,0 @@ -use tracing::{debug, error, info, instrument, span, warn, Level}; -use tracing_subscriber::{layer::SubscriberExt, registry::Registry}; -use tracing_tree::HierarchicalLayer; - -fn main() { - let layer = HierarchicalLayer::default() - .with_writer(std::io::stdout) - .with_indent_lines(true) - .with_indent_amount(2) - .with_thread_names(true) - .with_thread_ids(true) - .with_verbose_exit(false) - .with_verbose_entry(false) - .with_targets(true); - - let subscriber = Registry::default().with(layer); - tracing::subscriber::set_global_default(subscriber).unwrap(); - - let app_span = span!(Level::TRACE, "hierarchical-example", version = %0.1); - let _e = app_span.enter(); - - let server_span = span!(Level::TRACE, "server", host = "localhost", port = 8080); - let _e2 = server_span.enter(); - info!("starting"); - std::thread::sleep(std::time::Duration::from_millis(300)); - info!("listening"); - let peer1 = span!(Level::TRACE, "conn", peer_addr = "82.9.9.9", port = 42381); - peer1.in_scope(|| { - debug!("connected"); - std::thread::sleep(std::time::Duration::from_millis(300)); - debug!(length = 2, "message received"); - }); - drop(peer1); - let peer2 = span!(Level::TRACE, "conn", peer_addr = "8.8.8.8", port = 18230); - peer2.in_scope(|| { - std::thread::sleep(std::time::Duration::from_millis(300)); - debug!("connected"); - }); - drop(peer2); - let peer3 = span!( - Level::TRACE, - "foomp", - normal_var = 43, - "{} <- format string", - 42 - ); - peer3.in_scope(|| { - error!("hello"); - }); - drop(peer3); - let peer1 = span!(Level::TRACE, "conn", peer_addr = "82.9.9.9", port = 42381); - peer1.in_scope(|| { - warn!(algo = "xor", "weak encryption requested"); - std::thread::sleep(std::time::Duration::from_millis(300)); - debug!(length = 8, "response sent"); - debug!("disconnected"); - }); - drop(peer1); - let peer2 = span!(Level::TRACE, "conn", peer_addr = "8.8.8.8", port = 18230); - peer2.in_scope(|| { - debug!(length = 5, "message received"); - std::thread::sleep(std::time::Duration::from_millis(300)); - debug!(length = 8, "response sent"); - debug!("disconnected"); - }); - drop(peer2); - warn!("internal error"); - info!("exit"); -} - -#[instrument] -fn call_a(name: &str) { - info!(name, "got a name"); - call_b(name) -} - -#[instrument] -fn call_b(name: &str) { - info!(name, "got a name"); -} diff --git a/vendor/tracing-tree/examples/quiet.stdout b/vendor/tracing-tree/examples/quiet.stdout deleted file mode 100644 index 52160cb85..000000000 --- a/vendor/tracing-tree/examples/quiet.stdout +++ /dev/null @@ -1,28 +0,0 @@ -1:main┐quiet::hierarchical-example version=0.1 -1:main├─┐quiet::server host="localhost", port=8080 -1:main│ ├─ Xms INFO quiet starting -1:main│ ├─ Xms INFO quiet listening -1:main│ ├─┐quiet::conn peer_addr="82.9.9.9", port=42381 -1:main│ │ ├─ Xms DEBUG quiet connected -1:main│ │ ├─ Xms DEBUG quiet message received, length=2 -1:main│ ├─┘ -1:main│ ├─┐quiet::conn peer_addr="8.8.8.8", port=18230 -1:main│ │ ├─ Xms DEBUG quiet connected -1:main│ ├─┘ -1:main│ ├─┐quiet::foomp 42 <- format string, normal_var=43 -1:main│ │ ├─ Xms ERROR quiet hello -1:main│ ├─┘ -1:main│ ├─┐quiet::conn peer_addr="82.9.9.9", port=42381 -1:main│ │ ├─ Xms WARN quiet weak encryption requested, algo="xor" -1:main│ │ ├─ Xms DEBUG quiet response sent, length=8 -1:main│ │ ├─ Xms DEBUG quiet disconnected -1:main│ ├─┘ -1:main│ ├─┐quiet::conn peer_addr="8.8.8.8", port=18230 -1:main│ │ ├─ Xms DEBUG quiet message received, length=5 -1:main│ │ ├─ Xms DEBUG quiet response sent, length=8 -1:main│ │ ├─ Xms DEBUG quiet disconnected -1:main│ ├─┘ -1:main│ ├─ Xs WARN quiet internal error -1:main│ ├─ Xs INFO quiet exit -1:main├─┘ -1:main┘ diff --git a/vendor/tracing-tree/examples/stderr.rs b/vendor/tracing-tree/examples/stderr.rs deleted file mode 100644 index 75880a376..000000000 --- a/vendor/tracing-tree/examples/stderr.rs +++ /dev/null @@ -1,40 +0,0 @@ -use tracing::{debug, info, instrument}; -use tracing_subscriber::{layer::SubscriberExt, registry::Registry}; -use tracing_tree::HierarchicalLayer; - -#[instrument] -fn nth_fibonacci(n: u64) -> u64 { - if n == 0 || n == 1 { - debug!("Base case"); - 1 - } else { - debug!("Recursing"); - nth_fibonacci(n - 1) + nth_fibonacci(n - 2) - } -} - -#[instrument] -fn fibonacci_seq(to: u64) -> Vec<u64> { - let mut sequence = vec![]; - - for n in 0..=to { - debug!("Pushing {n} fibonacci", n = n); - sequence.push(nth_fibonacci(n)); - } - - sequence -} - -fn main() { - let layer = HierarchicalLayer::default() - .with_indent_lines(true) - .with_indent_amount(2) - .with_bracketed_fields(true); - - let subscriber = Registry::default().with(layer); - tracing::subscriber::set_global_default(subscriber).unwrap(); - - let n = 5; - let sequence = fibonacci_seq(n); - info!("The first {} fibonacci numbers are {:?}", n, sequence); -} diff --git a/vendor/tracing-tree/examples/stderr.stderr b/vendor/tracing-tree/examples/stderr.stderr deleted file mode 100644 index c1c242faf..000000000 --- a/vendor/tracing-tree/examples/stderr.stderr +++ /dev/null @@ -1,111 +0,0 @@ -┐fibonacci_seq{to=5} -├─ Xms DEBUG Pushing 0 fibonacci -├─┐nth_fibonacci{n=0} -│ ├─ Xms DEBUG Base case -├─┘ -├─ Xms DEBUG Pushing 1 fibonacci -├─┐nth_fibonacci{n=1} -│ ├─ Xms DEBUG Base case -├─┘ -├─ Xms DEBUG Pushing 2 fibonacci -├─┐nth_fibonacci{n=2} -│ ├─ Xms DEBUG Recursing -│ ├─┐nth_fibonacci{n=1} -│ │ ├─ Xms DEBUG Base case -│ ├─┘ -│ ├─┐nth_fibonacci{n=0} -│ │ ├─ Xms DEBUG Base case -│ ├─┘ -├─┘ -├─ Xms DEBUG Pushing 3 fibonacci -├─┐nth_fibonacci{n=3} -│ ├─ Xms DEBUG Recursing -│ ├─┐nth_fibonacci{n=2} -│ │ ├─ Xms DEBUG Recursing -│ │ ├─┐nth_fibonacci{n=1} -│ │ │ ├─ Xms DEBUG Base case -│ │ ├─┘ -│ │ ├─┐nth_fibonacci{n=0} -│ │ │ ├─ Xms DEBUG Base case -│ │ ├─┘ -│ ├─┘ -│ ├─┐nth_fibonacci{n=1} -│ │ ├─ Xms DEBUG Base case -│ ├─┘ -├─┘ -├─ Xms DEBUG Pushing 4 fibonacci -├─┐nth_fibonacci{n=4} -│ ├─ Xms DEBUG Recursing -│ ├─┐nth_fibonacci{n=3} -│ │ ├─ Xms DEBUG Recursing -│ │ ├─┐nth_fibonacci{n=2} -│ │ │ ├─ Xms DEBUG Recursing -│ │ │ ├─┐nth_fibonacci{n=1} -│ │ │ │ ├─ Xms DEBUG Base case -│ │ │ ├─┘ -│ │ │ ├─┐nth_fibonacci{n=0} -│ │ │ │ ├─ Xms DEBUG Base case -│ │ │ ├─┘ -│ │ ├─┘ -│ │ ├─┐nth_fibonacci{n=1} -│ │ │ ├─ Xms DEBUG Base case -│ │ ├─┘ -│ ├─┘ -│ ├─┐nth_fibonacci{n=2} -│ │ ├─ Xms DEBUG Recursing -│ │ ├─┐nth_fibonacci{n=1} -│ │ │ ├─ Xms DEBUG Base case -│ │ ├─┘ -│ │ ├─┐nth_fibonacci{n=0} -│ │ │ ├─ Xms DEBUG Base case -│ │ ├─┘ -│ ├─┘ -├─┘ -├─ Xms DEBUG Pushing 5 fibonacci -├─┐nth_fibonacci{n=5} -│ ├─ Xms DEBUG Recursing -│ ├─┐nth_fibonacci{n=4} -│ │ ├─ Xms DEBUG Recursing -│ │ ├─┐nth_fibonacci{n=3} -│ │ │ ├─ Xms DEBUG Recursing -│ │ │ ├─┐nth_fibonacci{n=2} -│ │ │ │ ├─ Xms DEBUG Recursing -│ │ │ │ ├─┐nth_fibonacci{n=1} -│ │ │ │ │ ├─ Xms DEBUG Base case -│ │ │ │ ├─┘ -│ │ │ │ ├─┐nth_fibonacci{n=0} -│ │ │ │ │ ├─ Xms DEBUG Base case -│ │ │ │ ├─┘ -│ │ │ ├─┘ -│ │ │ ├─┐nth_fibonacci{n=1} -│ │ │ │ ├─ Xms DEBUG Base case -│ │ │ ├─┘ -│ │ ├─┘ -│ │ ├─┐nth_fibonacci{n=2} -│ │ │ ├─ Xms DEBUG Recursing -│ │ │ ├─┐nth_fibonacci{n=1} -│ │ │ │ ├─ Xms DEBUG Base case -│ │ │ ├─┘ -│ │ │ ├─┐nth_fibonacci{n=0} -│ │ │ │ ├─ Xms DEBUG Base case -│ │ │ ├─┘ -│ │ ├─┘ -│ ├─┘ -│ ├─┐nth_fibonacci{n=3} -│ │ ├─ Xms DEBUG Recursing -│ │ ├─┐nth_fibonacci{n=2} -│ │ │ ├─ Xms DEBUG Recursing -│ │ │ ├─┐nth_fibonacci{n=1} -│ │ │ │ ├─ Xms DEBUG Base case -│ │ │ ├─┘ -│ │ │ ├─┐nth_fibonacci{n=0} -│ │ │ │ ├─ Xms DEBUG Base case -│ │ │ ├─┘ -│ │ ├─┘ -│ │ ├─┐nth_fibonacci{n=1} -│ │ │ ├─ Xms DEBUG Base case -│ │ ├─┘ -│ ├─┘ -├─┘ -┘ -INFO The first 5 fibonacci numbers are [1, 1, 2, 3, 5, 8] diff --git a/vendor/tracing-tree/examples/wraparound.rs b/vendor/tracing-tree/examples/wraparound.rs deleted file mode 100644 index e045eb9f2..000000000 --- a/vendor/tracing-tree/examples/wraparound.rs +++ /dev/null @@ -1,31 +0,0 @@ -use tracing::{instrument, warn}; -use tracing_subscriber::{layer::SubscriberExt, registry::Registry}; -use tracing_tree::HierarchicalLayer; - -fn main() { - let layer = HierarchicalLayer::default() - .with_writer(std::io::stdout) - .with_indent_lines(true) - .with_indent_amount(2) - .with_thread_names(true) - .with_thread_ids(true) - .with_targets(true) - .with_wraparound(5); - - let subscriber = Registry::default().with(layer); - tracing::subscriber::set_global_default(subscriber).unwrap(); - - recurse(0); -} - -#[instrument] -fn recurse(i: usize) { - warn!("boop"); - if i > 20 { - warn!("bop"); - return; - } else { - recurse(i + 1); - } - warn!("bop"); -} diff --git a/vendor/tracing-tree/examples/wraparound.stdout b/vendor/tracing-tree/examples/wraparound.stdout deleted file mode 100644 index 47022e093..000000000 --- a/vendor/tracing-tree/examples/wraparound.stdout +++ /dev/null @@ -1,96 +0,0 @@ -1:main┐wraparound::recurse i=0 -1:main├─ Xms WARN wraparound boop -1:main├─┐wraparound::recurse i=1 -1:main│ ├─ Xms WARN wraparound boop -1:main│ ├─┐wraparound::recurse i=2 -1:main│ │ ├─ Xms WARN wraparound boop -1:main│ │ ├─┐wraparound::recurse i=3 -1:main│ │ │ ├─ Xms WARN wraparound boop -1:main│ │ │ ├─┐wraparound::recurse i=4 -1:main────────┘ -1:main Xms WARN wraparound boop -1:main┐wraparound::recurse i=5 -1:main├─ Xms WARN wraparound boop -1:main├─┐wraparound::recurse i=6 -1:main│ ├─ Xms WARN wraparound boop -1:main│ ├─┐wraparound::recurse i=7 -1:main│ │ ├─ Xms WARN wraparound boop -1:main│ │ ├─┐wraparound::recurse i=8 -1:main│ │ │ ├─ Xms WARN wraparound boop -1:main│ │ │ ├─┐wraparound::recurse i=9 -1:main────────┘ -1:main Xms WARN wraparound boop -1:main┐wraparound::recurse i=10 -1:main├─ Xms WARN wraparound boop -1:main├─┐wraparound::recurse i=11 -1:main│ ├─ Xms WARN wraparound boop -1:main│ ├─┐wraparound::recurse i=12 -1:main│ │ ├─ Xms WARN wraparound boop -1:main│ │ ├─┐wraparound::recurse i=13 -1:main│ │ │ ├─ Xms WARN wraparound boop -1:main│ │ │ ├─┐wraparound::recurse i=14 -1:main────────┘ -1:main Xms WARN wraparound boop -1:main┐wraparound::recurse i=15 -1:main├─ Xms WARN wraparound boop -1:main├─┐wraparound::recurse i=16 -1:main│ ├─ Xms WARN wraparound boop -1:main│ ├─┐wraparound::recurse i=17 -1:main│ │ ├─ Xms WARN wraparound boop -1:main│ │ ├─┐wraparound::recurse i=18 -1:main│ │ │ ├─ Xms WARN wraparound boop -1:main│ │ │ ├─┐wraparound::recurse i=19 -1:main────────┘ -1:main Xms WARN wraparound boop -1:main┐wraparound::recurse i=20 -1:main├─ Xms WARN wraparound boop -1:main├─┐wraparound::recurse i=21 -1:main│ ├─ Xms WARN wraparound boop -1:main│ ├─ Xms WARN wraparound bop -1:main├─┘ -1:main├─ Xms WARN wraparound bop -1:main┘ -1:main Xms WARN wraparound bop -1:main────────┐ -1:main│ │ │ ├─┘ -1:main│ │ │ ├─ Xms WARN wraparound bop -1:main│ │ ├─┘ -1:main│ │ ├─ Xms WARN wraparound bop -1:main│ ├─┘ -1:main│ ├─ Xms WARN wraparound bop -1:main├─┘ -1:main├─ Xms WARN wraparound bop -1:main┘ -1:main Xms WARN wraparound bop -1:main────────┐ -1:main│ │ │ ├─┘ -1:main│ │ │ ├─ Xms WARN wraparound bop -1:main│ │ ├─┘ -1:main│ │ ├─ Xms WARN wraparound bop -1:main│ ├─┘ -1:main│ ├─ Xms WARN wraparound bop -1:main├─┘ -1:main├─ Xms WARN wraparound bop -1:main┘ -1:main Xms WARN wraparound bop -1:main────────┐ -1:main│ │ │ ├─┘ -1:main│ │ │ ├─ Xms WARN wraparound bop -1:main│ │ ├─┘ -1:main│ │ ├─ Xms WARN wraparound bop -1:main│ ├─┘ -1:main│ ├─ Xms WARN wraparound bop -1:main├─┘ -1:main├─ Xms WARN wraparound bop -1:main┘ -1:main Xms WARN wraparound bop -1:main────────┐ -1:main│ │ │ ├─┘ -1:main│ │ │ ├─ Xms WARN wraparound bop -1:main│ │ ├─┘ -1:main│ │ ├─ Xms WARN wraparound bop -1:main│ ├─┘ -1:main│ ├─ Xms WARN wraparound bop -1:main├─┘ -1:main├─ Xms WARN wraparound bop -1:main┘ diff --git a/vendor/tracing-tree/src/format.rs b/vendor/tracing-tree/src/format.rs deleted file mode 100644 index aa56178be..000000000 --- a/vendor/tracing-tree/src/format.rs +++ /dev/null @@ -1,427 +0,0 @@ -use nu_ansi_term::Color; -use std::{ - fmt::{self, Write as _}, - io, -}; -use tracing_core::{ - field::{Field, Visit}, - Level, -}; - -pub(crate) const LINE_VERT: &str = "│"; -const LINE_HORIZ: &str = "─"; -pub(crate) const LINE_BRANCH: &str = "├"; -pub(crate) const LINE_CLOSE: &str = "┘"; -pub(crate) const LINE_OPEN: &str = "┐"; - -#[derive(Copy, Clone)] -pub(crate) enum SpanMode { - PreOpen, - Open { verbose: bool }, - Close { verbose: bool }, - PostClose, - Event, -} - -#[derive(Debug)] -pub struct Config { - /// Whether to use colors. - pub ansi: bool, - /// Whether an ascii art tree is used or (if false) whether to just use whitespace indent - pub indent_lines: bool, - /// The amount of chars to indent. - pub indent_amount: usize, - /// Whether to show the module paths. - pub targets: bool, - /// Whether to show thread ids. - pub render_thread_ids: bool, - /// Whether to show thread names. - pub render_thread_names: bool, - /// Specifies after how many indentation levels we will wrap back around to zero - pub wraparound: usize, - /// Whether to print the current span before activating a new one - pub verbose_entry: bool, - /// Whether to print the current span before exiting it. - pub verbose_exit: bool, - /// Whether to print squiggly brackets (`{}`) around the list of fields in a span. - pub bracketed_fields: bool, -} - -impl Config { - pub fn with_ansi(self, ansi: bool) -> Self { - Self { ansi, ..self } - } - - pub fn with_indent_lines(self, indent_lines: bool) -> Self { - Self { - indent_lines, - ..self - } - } - - pub fn with_targets(self, targets: bool) -> Self { - Self { targets, ..self } - } - - pub fn with_thread_ids(self, render_thread_ids: bool) -> Self { - Self { - render_thread_ids, - ..self - } - } - - pub fn with_thread_names(self, render_thread_names: bool) -> Self { - Self { - render_thread_names, - ..self - } - } - - pub fn with_wraparound(self, wraparound: usize) -> Self { - Self { wraparound, ..self } - } - - pub fn with_verbose_entry(self, verbose_entry: bool) -> Self { - Self { - verbose_entry, - ..self - } - } - - pub fn with_verbose_exit(self, verbose_exit: bool) -> Self { - Self { - verbose_exit, - ..self - } - } - - pub fn with_bracketed_fields(self, bracketed_fields: bool) -> Self { - Self { - bracketed_fields, - ..self - } - } - - pub(crate) fn prefix(&self) -> String { - let mut buf = String::new(); - if self.render_thread_ids { - write!(buf, "{:?}", std::thread::current().id()).unwrap(); - if buf.ends_with(')') { - buf.truncate(buf.len() - 1); - } - if buf.starts_with("ThreadId(") { - buf.drain(0.."ThreadId(".len()); - } - } - if self.render_thread_names { - if let Some(name) = std::thread::current().name() { - if self.render_thread_ids { - buf.push(':'); - } - buf.push_str(name); - } - } - buf - } -} - -impl Default for Config { - fn default() -> Self { - Self { - ansi: true, - indent_lines: false, - indent_amount: 2, - targets: false, - render_thread_ids: false, - render_thread_names: false, - wraparound: usize::max_value(), - verbose_entry: false, - verbose_exit: false, - bracketed_fields: false, - } - } -} - -#[derive(Debug)] -pub struct Buffers { - pub current_buf: String, - pub indent_buf: String, -} - -impl Buffers { - pub fn new() -> Self { - Self { - current_buf: String::new(), - indent_buf: String::new(), - } - } - - pub fn flush_current_buf(&mut self, mut writer: impl io::Write) { - write!(writer, "{}", &self.current_buf).unwrap(); - self.current_buf.clear(); - } - - pub fn flush_indent_buf(&mut self) { - self.current_buf.push_str(&self.indent_buf); - self.indent_buf.clear(); - } - - pub(crate) fn indent_current(&mut self, indent: usize, config: &Config, style: SpanMode) { - let prefix = config.prefix(); - - // Render something when wraparound occurs so the user is aware of it - if config.indent_lines { - self.current_buf.push('\n'); - - match style { - SpanMode::Close { .. } | SpanMode::PostClose => { - if indent > 0 && (indent + 1) % config.wraparound == 0 { - self.indent_buf.push_str(&prefix); - for _ in 0..(indent % config.wraparound * config.indent_amount) { - self.indent_buf.push_str(LINE_HORIZ); - } - self.indent_buf.push_str(LINE_OPEN); - self.indent_buf.push('\n'); - } - } - _ => {} - } - } - - indent_block( - &mut self.current_buf, - &mut self.indent_buf, - indent % config.wraparound, - config.indent_amount, - config.indent_lines, - &prefix, - style, - ); - self.current_buf.clear(); - self.flush_indent_buf(); - - // Render something when wraparound occurs so the user is aware of it - if config.indent_lines { - match style { - SpanMode::PreOpen | SpanMode::Open { .. } => { - if indent > 0 && (indent + 1) % config.wraparound == 0 { - self.current_buf.push_str(&prefix); - for _ in 0..(indent % config.wraparound * config.indent_amount) { - self.current_buf.push_str(LINE_HORIZ); - } - self.current_buf.push_str(LINE_CLOSE); - self.current_buf.push('\n'); - } - } - _ => {} - } - } - } -} - -pub struct FmtEvent<'a> { - pub bufs: &'a mut Buffers, - pub comma: bool, -} - -impl<'a> Visit for FmtEvent<'a> { - fn record_debug(&mut self, field: &Field, value: &dyn fmt::Debug) { - let buf = &mut self.bufs.current_buf; - let comma = if self.comma { "," } else { "" }; - match field.name() { - "message" => { - write!(buf, "{} {:?}", comma, value).unwrap(); - self.comma = true; - } - // Skip fields that are actually log metadata that have already been handled - #[cfg(feature = "tracing-log")] - name if name.starts_with("log.") => {} - name => { - write!(buf, "{} {}={:?}", comma, name, value).unwrap(); - self.comma = true; - } - } - } -} - -pub struct ColorLevel<'a>(pub &'a Level); - -impl<'a> fmt::Display for ColorLevel<'a> { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match *self.0 { - Level::TRACE => Color::Purple.bold().paint("TRACE"), - Level::DEBUG => Color::Blue.bold().paint("DEBUG"), - Level::INFO => Color::Green.bold().paint(" INFO"), - Level::WARN => Color::Rgb(252, 234, 160).bold().paint(" WARN"), // orange - Level::ERROR => Color::Red.bold().paint("ERROR"), - } - .fmt(f) - } -} - -fn indent_block_with_lines( - lines: &[&str], - buf: &mut String, - indent: usize, - indent_amount: usize, - prefix: &str, - style: SpanMode, -) { - let indent_spaces = indent * indent_amount; - if lines.is_empty() { - return; - } else if indent_spaces == 0 { - for line in lines { - buf.push_str(prefix); - // The first indent is special, we only need to print open/close and nothing else - if indent == 0 { - match style { - SpanMode::Open { .. } => buf.push_str(LINE_OPEN), - SpanMode::Close { .. } => buf.push_str(LINE_CLOSE), - SpanMode::PreOpen | SpanMode::PostClose => {} - SpanMode::Event => {} - } - } - buf.push_str(line); - buf.push('\n'); - } - return; - } - let mut s = String::with_capacity(indent_spaces + prefix.len()); - s.push_str(prefix); - - // instead of using all spaces to indent, draw a vertical line at every indent level - // up until the last indent - for i in 0..(indent_spaces - indent_amount) { - if i % indent_amount == 0 { - s.push_str(LINE_VERT); - } else { - s.push(' '); - } - } - - // draw branch - buf.push_str(&s); - - match style { - SpanMode::PreOpen => { - buf.push_str(LINE_BRANCH); - for _ in 1..(indent_amount / 2) { - buf.push_str(LINE_HORIZ); - } - buf.push_str(LINE_OPEN); - } - SpanMode::Open { verbose: false } => { - buf.push_str(LINE_BRANCH); - for _ in 1..indent_amount { - buf.push_str(LINE_HORIZ); - } - buf.push_str(LINE_OPEN); - } - SpanMode::Open { verbose: true } => { - buf.push_str(LINE_VERT); - for _ in 1..(indent_amount / 2) { - buf.push(' '); - } - // We don't have the space for fancy rendering at single space indent. - if indent_amount > 1 { - buf.push('└'); - } - for _ in (indent_amount / 2)..(indent_amount - 1) { - buf.push_str(LINE_HORIZ); - } - // We don't have the space for fancy rendering at single space indent. - if indent_amount > 1 { - buf.push_str(LINE_OPEN); - } else { - buf.push_str(LINE_VERT); - } - } - SpanMode::Close { verbose: false } => { - buf.push_str(LINE_BRANCH); - for _ in 1..indent_amount { - buf.push_str(LINE_HORIZ); - } - buf.push_str(LINE_CLOSE); - } - SpanMode::Close { verbose: true } => { - buf.push_str(LINE_VERT); - for _ in 1..(indent_amount / 2) { - buf.push(' '); - } - // We don't have the space for fancy rendering at single space indent. - if indent_amount > 1 { - buf.push('┌'); - } - for _ in (indent_amount / 2)..(indent_amount - 1) { - buf.push_str(LINE_HORIZ); - } - // We don't have the space for fancy rendering at single space indent. - if indent_amount > 1 { - buf.push_str(LINE_CLOSE); - } else { - buf.push_str(LINE_VERT); - } - } - SpanMode::PostClose => { - buf.push_str(LINE_BRANCH); - for _ in 1..(indent_amount / 2) { - buf.push_str(LINE_HORIZ); - } - buf.push_str(LINE_CLOSE); - } - SpanMode::Event => { - buf.push_str(LINE_BRANCH); - - // add `indent_amount - 1` horizontal lines before the span/event - for _ in 0..(indent_amount - 1) { - buf.push_str(LINE_HORIZ); - } - } - } - buf.push_str(lines[0]); - buf.push('\n'); - - // add the rest of the indentation, since we don't want to draw horizontal lines - // for subsequent lines - for i in 0..indent_amount { - if i % indent_amount == 0 { - s.push_str(LINE_VERT); - } else { - s.push(' '); - } - } - - // add all of the actual content, with each line preceded by the indent string - for line in &lines[1..] { - buf.push_str(&s); - buf.push_str(line); - buf.push('\n'); - } -} - -fn indent_block( - block: &mut String, - buf: &mut String, - indent: usize, - indent_amount: usize, - indent_lines: bool, - prefix: &str, - style: SpanMode, -) { - let lines: Vec<&str> = block.lines().collect(); - let indent_spaces = indent * indent_amount; - buf.reserve(block.len() + (lines.len() * indent_spaces)); - if indent_lines { - indent_block_with_lines(&lines, buf, indent, indent_amount, prefix, style); - } else { - let indent_str = String::from(" ").repeat(indent_spaces); - for line in lines { - buf.push_str(prefix); - buf.push(' '); - buf.push_str(&indent_str); - buf.push_str(line); - buf.push('\n'); - } - } -} diff --git a/vendor/tracing-tree/src/lib.rs b/vendor/tracing-tree/src/lib.rs deleted file mode 100644 index d171c7608..000000000 --- a/vendor/tracing-tree/src/lib.rs +++ /dev/null @@ -1,436 +0,0 @@ -pub(crate) mod format; -pub mod time; - -use crate::time::FormatTime; -use format::{Buffers, ColorLevel, Config, FmtEvent, SpanMode}; - -use is_terminal::IsTerminal; -use nu_ansi_term::{Color, Style}; -use std::{ - fmt::{self, Write as _}, - io, - sync::Mutex, - time::Instant, -}; -use tracing_core::{ - field::{Field, Visit}, - span::{Attributes, Id}, - Event, Subscriber, -}; -#[cfg(feature = "tracing-log")] -use tracing_log::NormalizeEvent; -use tracing_subscriber::{ - fmt::MakeWriter, - layer::{Context, Layer}, - registry::{self, LookupSpan}, -}; - -pub(crate) struct Data { - start: Instant, - kvs: Vec<(&'static str, String)>, -} - -impl Data { - pub fn new(attrs: &Attributes<'_>) -> Self { - let mut span = Self { - start: Instant::now(), - kvs: Vec::new(), - }; - attrs.record(&mut span); - span - } -} - -impl Visit for Data { - fn record_debug(&mut self, field: &Field, value: &dyn fmt::Debug) { - self.kvs.push((field.name(), format!("{:?}", value))) - } -} -#[derive(Debug)] -pub struct HierarchicalLayer<W = fn() -> io::Stderr, FT = ()> -where - W: for<'writer> MakeWriter<'writer> + 'static, - FT: FormatTime, -{ - make_writer: W, - bufs: Mutex<Buffers>, - config: Config, - timer: FT, -} - -impl Default for HierarchicalLayer { - fn default() -> Self { - Self::new(2) - } -} - -impl HierarchicalLayer<fn() -> io::Stderr> { - pub fn new(indent_amount: usize) -> Self { - let ansi = io::stderr().is_terminal(); - let config = Config { - ansi, - indent_amount, - ..Default::default() - }; - Self { - make_writer: io::stderr, - bufs: Mutex::new(Buffers::new()), - config, - timer: (), - } - } -} - -impl<W, FT> HierarchicalLayer<W, FT> -where - W: for<'writer> MakeWriter<'writer> + 'static, - FT: FormatTime, -{ - /// Enables terminal colors, boldness and italics. - pub fn with_ansi(self, ansi: bool) -> Self { - Self { - config: self.config.with_ansi(ansi), - ..self - } - } - - pub fn with_writer<W2>(self, make_writer: W2) -> HierarchicalLayer<W2, FT> - where - W2: for<'writer> MakeWriter<'writer>, - { - HierarchicalLayer { - make_writer, - config: self.config, - bufs: self.bufs, - timer: self.timer, - } - } - - pub fn with_indent_amount(self, indent_amount: usize) -> Self { - let config = Config { - indent_amount, - ..self.config - }; - Self { config, ..self } - } - - /// Renders an ascii art tree instead of just using whitespace indentation. - pub fn with_indent_lines(self, indent_lines: bool) -> Self { - Self { - config: self.config.with_indent_lines(indent_lines), - ..self - } - } - - /// Specifies how to measure and format time at which event has occurred. - pub fn with_timer<FT2: FormatTime>(self, timer: FT2) -> HierarchicalLayer<W, FT2> { - HierarchicalLayer { - make_writer: self.make_writer, - config: self.config, - bufs: self.bufs, - timer, - } - } - - /// Whether to render the event and span targets. Usually targets are the module path to the - /// event/span macro invocation. - pub fn with_targets(self, targets: bool) -> Self { - Self { - config: self.config.with_targets(targets), - ..self - } - } - - /// Whether to render the thread id in the beginning of every line. This is helpful to - /// untangle the tracing statements emitted by each thread. - pub fn with_thread_ids(self, thread_ids: bool) -> Self { - Self { - config: self.config.with_thread_ids(thread_ids), - ..self - } - } - - /// Whether to render the thread name in the beginning of every line. Not all threads have - /// names, but if they do, this may be more helpful than the generic thread ids. - pub fn with_thread_names(self, thread_names: bool) -> Self { - Self { - config: self.config.with_thread_names(thread_names), - ..self - } - } - - /// Resets the indentation to zero after `wraparound` indentation levels. - /// This is helpful if you expect very deeply nested spans as otherwise the indentation - /// just runs out of your screen. - pub fn with_wraparound(self, wraparound: usize) -> Self { - Self { - config: self.config.with_wraparound(wraparound), - ..self - } - } - - /// Whether to print the currently active span's message again before entering a new span. - /// This helps if the entry to the current span was quite a while back (and with scrolling - /// upwards in logs). - pub fn with_verbose_entry(self, verbose_entry: bool) -> Self { - Self { - config: self.config.with_verbose_entry(verbose_entry), - ..self - } - } - - /// Whether to print the currently active span's message again before dropping it. - /// This helps if the entry to the current span was quite a while back (and with scrolling - /// upwards in logs). - pub fn with_verbose_exit(self, verbose_exit: bool) -> Self { - Self { - config: self.config.with_verbose_exit(verbose_exit), - ..self - } - } - - /// Whether to print `{}` around the fields when printing a span. - /// This can help visually distinguish fields from the rest of the message. - pub fn with_bracketed_fields(self, bracketed_fields: bool) -> Self { - Self { - config: self.config.with_bracketed_fields(bracketed_fields), - ..self - } - } - - fn styled(&self, style: Style, text: impl AsRef<str>) -> String { - if self.config.ansi { - style.paint(text.as_ref()).to_string() - } else { - text.as_ref().to_string() - } - } - - fn print_kvs<'a, I, V>(&self, buf: &mut impl fmt::Write, kvs: I) -> fmt::Result - where - I: IntoIterator<Item = (&'a str, V)>, - V: fmt::Display + 'a, - { - let mut kvs = kvs.into_iter(); - if let Some((k, v)) = kvs.next() { - if k == "message" { - write!(buf, "{}", v)?; - } else { - write!(buf, "{}={}", k, v)?; - } - } - for (k, v) in kvs { - write!(buf, ", {}={}", k, v)?; - } - Ok(()) - } - - fn write_span_info<S>(&self, id: &Id, ctx: &Context<S>, style: SpanMode) - where - S: Subscriber + for<'span> LookupSpan<'span>, - { - let span = ctx - .span(id) - .expect("in on_enter/on_exit but span does not exist"); - let ext = span.extensions(); - let data = ext.get::<Data>().expect("span does not have data"); - - let mut guard = self.bufs.lock().unwrap(); - let bufs = &mut *guard; - let mut current_buf = &mut bufs.current_buf; - - let indent = ctx - .lookup_current() - .as_ref() - .map(registry::SpanRef::scope) - .map(registry::Scope::from_root) - .into_iter() - .flatten() - .count(); - - if self.config.verbose_entry || matches!(style, SpanMode::Open { .. } | SpanMode::Event) { - if self.config.targets { - let target = span.metadata().target(); - write!( - &mut current_buf, - "{}::", - self.styled(Style::new().dimmed(), target,), - ) - .expect("Unable to write to buffer"); - } - - write!( - current_buf, - "{name}", - name = self.styled(Style::new().fg(Color::Green).bold(), span.metadata().name()) - ) - .unwrap(); - if self.config.bracketed_fields { - write!( - current_buf, - "{}", - self.styled(Style::new().fg(Color::Green).bold(), "{") // Style::new().fg(Color::Green).dimmed().paint("{") - ) - .unwrap(); - } else { - write!(current_buf, " ").unwrap(); - } - self.print_kvs(&mut current_buf, data.kvs.iter().map(|(k, v)| (*k, v))) - .unwrap(); - if self.config.bracketed_fields { - write!( - current_buf, - "{}", - self.styled(Style::new().fg(Color::Green).bold(), "}") // Style::new().dimmed().paint("}") - ) - .unwrap(); - } - } - - bufs.indent_current(indent, &self.config, style); - let writer = self.make_writer.make_writer(); - bufs.flush_current_buf(writer) - } -} - -impl<S, W, FT> Layer<S> for HierarchicalLayer<W, FT> -where - S: Subscriber + for<'span> LookupSpan<'span>, - W: for<'writer> MakeWriter<'writer> + 'static, - FT: FormatTime + 'static, -{ - fn on_new_span(&self, attrs: &Attributes, id: &Id, ctx: Context<S>) { - let span = ctx.span(id).expect("in new_span but span does not exist"); - if span.extensions().get::<Data>().is_none() { - let data = Data::new(attrs); - span.extensions_mut().insert(data); - } - - if self.config.verbose_exit { - if let Some(span) = span.parent() { - self.write_span_info(&span.id(), &ctx, SpanMode::PreOpen); - } - } - - self.write_span_info( - id, - &ctx, - SpanMode::Open { - verbose: self.config.verbose_entry, - }, - ); - } - - fn on_event(&self, event: &Event<'_>, ctx: Context<S>) { - let mut guard = self.bufs.lock().unwrap(); - let bufs = &mut *guard; - let mut event_buf = &mut bufs.current_buf; - - // Time. - - { - let prev_buffer_len = event_buf.len(); - - self.timer - .format_time(&mut event_buf) - .expect("Unable to write time to buffer"); - - // Something was written to the buffer, pad it with a space. - if prev_buffer_len < event_buf.len() { - write!(event_buf, " ").expect("Unable to write to buffer"); - } - } - - // printing the indentation - let indent = ctx - .event_scope(event) - .map(|scope| scope.count()) - .unwrap_or(0); - - // check if this event occurred in the context of a span. - // if it has, get the start time of this span. - let start = match ctx.current_span().id() { - Some(id) => match ctx.span(id) { - // if the event is in a span, get the span's starting point. - Some(ctx) => { - let ext = ctx.extensions(); - let data = ext - .get::<Data>() - .expect("Data cannot be found in extensions"); - Some(data.start) - } - None => None, - }, - None => None, - }; - if let Some(start) = start { - let elapsed = start.elapsed(); - let millis = elapsed.as_millis(); - let secs = elapsed.as_secs(); - let (n, unit) = if millis < 1000 { - (millis as _, "ms") - } else if secs < 60 { - (secs, "s ") - } else { - (secs / 60, "m ") - }; - let n = format!("{n:>3}"); - write!( - &mut event_buf, - "{timestamp}{unit} ", - timestamp = self.styled(Style::new().dimmed(), n), - unit = self.styled(Style::new().dimmed(), unit), - ) - .expect("Unable to write to buffer"); - } - - #[cfg(feature = "tracing-log")] - let normalized_meta = event.normalized_metadata(); - #[cfg(feature = "tracing-log")] - let metadata = normalized_meta.as_ref().unwrap_or_else(|| event.metadata()); - #[cfg(not(feature = "tracing-log"))] - let metadata = event.metadata(); - - let level = metadata.level(); - let level = if self.config.ansi { - ColorLevel(level).to_string() - } else { - level.to_string() - }; - write!(&mut event_buf, "{level}", level = level).expect("Unable to write to buffer"); - - if self.config.targets { - let target = metadata.target(); - write!( - &mut event_buf, - " {}", - self.styled(Style::new().dimmed(), target,), - ) - .expect("Unable to write to buffer"); - } - - let mut visitor = FmtEvent { comma: false, bufs }; - event.record(&mut visitor); - visitor - .bufs - .indent_current(indent, &self.config, SpanMode::Event); - let writer = self.make_writer.make_writer(); - bufs.flush_current_buf(writer) - } - - fn on_close(&self, id: Id, ctx: Context<S>) { - self.write_span_info( - &id, - &ctx, - SpanMode::Close { - verbose: self.config.verbose_exit, - }, - ); - - if self.config.verbose_exit { - if let Some(span) = ctx.span(&id).and_then(|span| span.parent()) { - self.write_span_info(&span.id(), &ctx, SpanMode::PostClose); - } - } - } -} diff --git a/vendor/tracing-tree/src/time.rs b/vendor/tracing-tree/src/time.rs deleted file mode 100644 index e0f81d47d..000000000 --- a/vendor/tracing-tree/src/time.rs +++ /dev/null @@ -1,119 +0,0 @@ -/// A type that can measure and format the current time. -/// -/// This trait is used by [HierarchicalLayer] to include a timestamp with each -/// [Event] when it is logged. -/// -/// Notable default implementations of this trait are [LocalDateTime] and `()`. -/// The former prints the current time as reported by [time's OffsetDateTime] -/// (note that it requires a `time` feature to be enabled and may panic! -/// make sure to check out the docs for the [LocalDateTime]), -/// and the latter does not print the current time at all. -/// -/// Inspired by the [FormatTime] trait from [tracing-subscriber]. -/// -/// [HierarchicalLayer]: crate::HierarchicalLayer -/// [Event]: tracing_core::Event -/// [time's OffsetDateTime]: time::OffsetDateTime -/// [FormatTime]: tracing_subscriber::fmt::time::FormatTime -/// [tracing-subscriber]: tracing_subscriber -// NB: -// We can't use `tracing_subscriber::fmt::format::Writer` -// since it doesn't have a public constructor. -pub trait FormatTime { - fn format_time(&self, w: &mut impl std::fmt::Write) -> std::fmt::Result; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -/// Default do-nothing time formatter. -impl FormatTime for () { - fn format_time(&self, _w: &mut impl std::fmt::Write) -> std::fmt::Result { - Ok(()) - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -/// Retrieve and print the current wall-clock time in UTC timezone. -#[cfg(feature = "time")] -#[derive(Debug, Clone, Copy, Eq, PartialEq, Default)] -pub struct UtcDateTime; - -#[cfg(feature = "time")] -impl FormatTime for UtcDateTime { - fn format_time(&self, w: &mut impl std::fmt::Write) -> std::fmt::Result { - let time = time::OffsetDateTime::now_utc(); - write!(w, "{} {}", time.date(), time.time()) - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -/// Retrieve and print the current wall-clock time. -/// -/// # Panics -/// -/// Panics if [time crate] cannot determine the local UTC offset. -/// -/// [time crate]: time -// NB: -// Can't use `tracing_subscriber::fmt::time::SystemTime` since it uses -// private `datetime` module to format the actual time. -#[cfg(feature = "time")] -#[derive(Debug, Clone, Copy, Eq, PartialEq, Default)] -pub struct LocalDateTime; - -#[cfg(feature = "time")] -impl FormatTime for LocalDateTime { - fn format_time(&self, w: &mut impl std::fmt::Write) -> std::fmt::Result { - let time = time::OffsetDateTime::now_local().expect("time offset cannot be determined"); - write!(w, "{}", time) - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -/// Retrieve and print the relative elapsed wall-clock time since an epoch. -/// -/// The `Default` implementation for `Uptime` makes the epoch the current time. -// NB: Copy-pasted from `tracing-subscriber::fmt::time::Uptime`. -#[derive(Debug, Clone, Copy, Eq, PartialEq)] -pub struct Uptime { - epoch: std::time::Instant, -} - -impl Default for Uptime { - fn default() -> Self { - Uptime { - epoch: std::time::Instant::now(), - } - } -} - -impl From<std::time::Instant> for Uptime { - fn from(epoch: std::time::Instant) -> Self { - Uptime { epoch } - } -} - -impl FormatTime for Uptime { - fn format_time(&self, w: &mut impl std::fmt::Write) -> std::fmt::Result { - let e = self.epoch.elapsed(); - write!(w, "{:4}.{:06}s", e.as_secs(), e.subsec_micros()) - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -impl<'a, F> FormatTime for &'a F -where - F: FormatTime, -{ - fn format_time(&self, w: &mut impl std::fmt::Write) -> std::fmt::Result { - (*self).format_time(w) - } -} - -// NB: -// Can't impl for `fn(&mut impl std::fmt::Write)` since impl trait is not allowed -// outside of function and inherent method return types for now. diff --git a/vendor/tracing-tree/tests/format_time.rs b/vendor/tracing-tree/tests/format_time.rs deleted file mode 100644 index b24b16652..000000000 --- a/vendor/tracing-tree/tests/format_time.rs +++ /dev/null @@ -1,79 +0,0 @@ -use std::{ - fmt::Write, - sync::{ - atomic::{AtomicU64, Ordering}, - Arc, - }, -}; - -use tracing::{span, Level}; -use tracing_subscriber::{layer::SubscriberExt, Registry}; - -use tracing_tree::{time::FormatTime, HierarchicalLayer}; - -#[derive(Debug)] -struct FormatTimeCounter(Arc<AtomicU64>); - -impl FormatTime for FormatTimeCounter { - fn format_time(&self, _w: &mut impl Write) -> std::fmt::Result { - self.0.fetch_add(1, Ordering::Relaxed); - Ok(()) - } -} - -#[test] -fn format_time_num_calls() { - let num_called = Arc::new(AtomicU64::new(0)); - let format_time_counter = FormatTimeCounter(Arc::clone(&num_called)); - - let layer = HierarchicalLayer::default() - .with_writer(std::io::stdout) - .with_indent_lines(true) - .with_indent_amount(2) - .with_timer(format_time_counter) - .with_thread_names(true) - .with_thread_ids(true) - .with_verbose_exit(true) - .with_verbose_entry(true) - .with_targets(true); - - let subscriber = Registry::default().with(layer); - tracing::subscriber::set_global_default(subscriber).unwrap(); - - let test_span = span!(Level::TRACE, "format-time-num-calls-test", version = %0.1); - let _e = test_span.enter(); - - tracing::info!("first event"); - assert_eq!(num_called.load(Ordering::Relaxed), 1); - - std::thread::sleep(std::time::Duration::from_millis(100)); - tracing::info!("second event"); - assert_eq!(num_called.load(Ordering::Relaxed), 2); - - let nested_span = span!(Level::TRACE, "nested-span"); - nested_span.in_scope(|| { - tracing::debug!("nested event"); - assert_eq!(num_called.load(Ordering::Relaxed), 3); - - tracing::info!("important nested event"); - assert_eq!(num_called.load(Ordering::Relaxed), 4); - }); - drop(nested_span); - - instrumented_function(); - assert_eq!(num_called.load(Ordering::Relaxed), 6); - - tracing::info!("exiting"); - assert_eq!(num_called.load(Ordering::Relaxed), 7); -} - -#[tracing::instrument] -fn instrumented_function() { - tracing::info!("instrumented function"); - nested_instrumented_function(); -} - -#[tracing::instrument] -fn nested_instrumented_function() { - tracing::warn!("nested instrumented function"); -} diff --git a/vendor/tracing-tree/tests/ui.rs b/vendor/tracing-tree/tests/ui.rs deleted file mode 100644 index cca8241d1..000000000 --- a/vendor/tracing-tree/tests/ui.rs +++ /dev/null @@ -1,23 +0,0 @@ -use ui_test::{color_eyre::Result, run_tests, Config, Mode, OutputConflictHandling}; - -fn main() -> Result<()> { - let mut config = Config::default(); - config.root_dir = "examples".into(); - config.dependencies_crate_manifest_path = Some("test_dependencies/Cargo.toml".into()); - config.args.push("--cfg".into()); - config.args.push("feature=\"tracing-log\"".into()); - config.out_dir = Some("target/ui_test".into()); - config.mode = Mode::Run { exit_code: 0 }; - config.stdout_filter("[0-9]{3}(ms|s|m)", " X$1"); - config.stdout_filter("[0-9]{2}(ms|s|m)", " X$1"); - config.stdout_filter("[0-9]{1}(ms|s|m)", "X$1"); - config.stderr_filter("[0-9]{3}(ms|s|m)", " X$1"); - config.stderr_filter("[0-9]{2}(ms|s|m)", " X$1"); - config.stderr_filter("[0-9]{1}(ms|s|m)", "X$1"); - config.output_conflict_handling = if std::env::args().any(|arg| arg == "--bless") { - OutputConflictHandling::Bless - } else { - OutputConflictHandling::Error - }; - run_tests(config) -} |