Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Owned format descriptions #429

Closed
Roguelazer opened this issue Jan 19, 2022 · 2 comments
Closed

Owned format descriptions #429

Roguelazer opened this issue Jan 19, 2022 · 2 comments
Labels
A-format-description Area: format description C-feature-request Category: a new feature (not already implemented)

Comments

@Roguelazer
Copy link

Roguelazer commented Jan 19, 2022

I'd like to have an API where clients can pass in a format string, it'll get parsed once, and the resulting Vec<FormatItem<'_>> can be reused for many formatting operations. Unfortunately, as far as I can tell, there's no "owned" equivalent of FormatItem, so this requires that I carry around a lifetime everywhere. Example:

struct SomeApplication<'a> {
    formatter: Vec<time::format_description::FormatItem<'a>>,
}

impl<'a> SomeApplication<'a> {
    fn new(format_string: &'a str) -> Result<Self, time::error::InvalidFormatDescription> {
        Ok(Self {
            formatter: time::format_description::parse(format_string)?,
        })
    }
}

The only way to avoid a lifetime dependency on the format string is to do something like Box::leak(string.into_boxed_str) to promote the string to a static lifetime and leak it, which is of course gross. One could also use ouroboros or equivalent to make a self-referential struct, but that seems like unnecessarily-deep magic for this use case.

It would be very nice if there were an owned equivalent of FormatItem. ToOwned is implemented for FormatItem, but it's just the auto-impl from Clone so it ends up being a shallow copy (and still has the same lifetime)

I don't have any strong feelings about the API; I could most easily imagine having an OwnedFormatItem which implements std::borrow::Borrow<FormatItem<'a>> (although using Borrow with structs that have a lifetime is often fraught with peril).

Note that this is basically the same as the question in #353, but since my format strings are user-provided runtime configuration, I can't use the format_description! macro.

Thoughts?

I prototyped something (poorly) and will attach a diff to this issue.

@jhpratt
Copy link
Member

jhpratt commented Jan 19, 2022

I'll have to think about this some more, but it seems reasonable. I've dealt with lifetime hell before, so I understand the concern.

I don't think this strictly needs to implement Borrow<FormatItem<'a>>, but it's reasonable to implement it if possible. As you noted, the Borrow trait has some major limitations.

I'll take a look at your PR when I get a chance. I'm quite busy with a few things nowadays, so that'll likely be a bit.

bors bot added a commit to probe-rs/probe-rs that referenced this issue Apr 20, 2022
1083: build(deps): update simplelog requirement from 0.11.0 to 0.12.0 in /probe-rs-cli-util r=Tiwalun a=dependabot[bot]

Updates the requirements on [simplelog](https://github.com/drakulix/simplelog.rs) to permit the latest version.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/Drakulix/simplelog.rs/blob/master/CHANGELOG.md">simplelog's changelog</a>.</em></p>
<blockquote>
<h2>v0.12.0</h2>
<pre><code>- Replaces the semingly unmainted chrono library with the time crate.
- Addresses through this update 
    - RUSTSEC-2020-0159 (chrono)
    - RUSTSEC-2020-0071 (time)
- `ConfigBuilder::set_time_to_local` is replaced by `ConfigBuilder::set_time_offset_to_local`.
    - This function requires the new (and by default activated) `local-offset` feature.
    - This function may fail, for more information read the docs.
    - simplelog will not determine the local offset dynamically anymore, but only once, when this config option is set.
        - Due to safety reasons there is no way to provide this property currently.
- `ConfigBuilder::set_time_offset` now takes a `time::UtcOffset` instead of a `chrono::FixedOffset`.
- `ConfigBuilder::set_time_format` has been replaced by three new variants
    - `ConfigBuilder::set_time_format_rfc2822` sets the time format to use the format described by rfc2822.
    - `ConfigBuilder::set_time_format_rfc3339` sets the time format to use the format described by rfc3339.
    - `ConfigBuilder::set_time_format_custom` sets the time format to a custom time format best created using `time::macros::format_description`.
        - Runtime provided time format configuration is possible, but difficult due to lifetime constraints.
        - Fixing this will require a solution to time-rs/time#429
    - *Note*: The default format is unchanged &quot;[hour]:[minute]:[second]&quot;
</code></pre>
<h2>v0.11.0</h2>
<pre><code>- Add colored log levels using `ansi_term` (PR [#88](Drakulix/simplelog.rs#88), credits to `@manio)`
- Add target padding (PR [#85](Drakulix/simplelog.rs#85), credits to `@bytebeamio)`
- Add optional color and style support using `paris` crate (PR [#84](Drakulix/simplelog.rs#84), credits to `@manio)`
</code></pre>
<h2>v0.10.2</h2>
<pre><code>- Fix flushing with `BufferedStandardStreams` (PR [#82](Drakulix/simplelog.rs#82), credits to `@mrkline)`
</code></pre>
<h2>v0.10.1</h2>
<pre><code>- Fix TermLogger performance using `termcolor::BufferedStandardStream` (PR [#80](Drakulix/simplelog.rs#80), credits to `@mrkline)`
- Add write thread name support for `termlog` (PR [#76](Drakulix/simplelog.rs#76), credits to `@zeroflaw)`
</code></pre>
<h2>v0.10.0</h2>
<pre><code>- Fix wrong argument naming (PR [#70](Drakulix/simplelog.rs#70), credits to `@scvalex)`
- *Breaking*: More color customization options (PR [#72](Drakulix/simplelog.rs#72), credits to `@mrkline)`
- Clarify docs on config levels
</code></pre>
<h2>v0.9.0</h2>
<pre><code>- Add customizable level label colors (PR [#69](Drakulix/simplelog.rs#69). credits to `@JarrettBillingsley)`
- Remove unneeded TermLogError
- Future-proof config by adding `#[non_exhaustive]`
- Fix compiling with minimal-versions
</code></pre>
<h2>v0.8.0</h2>
<pre><code>- Switch from `term` to `termcolor` (PR [#59](Drakulix/simplelog.rs#59). credits to `@raybritton)`
- Fix typo in docs (PR [#58](Drakulix/simplelog.rs#58), credits to `@anthonyjmartinez)`
- Switch default padding to `Off`. Padding is annoyingly controversal, just set it to whatever you prefer, if you want it.
</code></pre>
<h2>v0.7.6</h2>
<pre><code>- Derive `Clone`,`Copy`,`PartialEq`,`Eq`,`Debug` and `Hash` for `TerminalMode`. (PR [#56](Drakulix/simplelog.rs#56), credits to `@panhania)`
</code></pre>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/95275c88b14f204a5e8278cd98072e4ffb0bc7d8"><code>95275c8</code></a> v0.12.0</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/f137eb4a2934faaec2d45652d14065f8560e5c49"><code>f137eb4</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/101">#101</a> from jacobtread/patch-1</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/ba172540f9e8eb0b31c65e43e234fe3cdc979ee6"><code>ba17254</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/99">#99</a> from zjp-CN/master</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/44a294fcff08818f5a8a889901508e62adb1bd29"><code>44a294f</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/95">#95</a> from Drakulix/fix/chrono_dep</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/d9257919d9e4afdf9d7385c4eb07f6031b6a17d9"><code>d925791</code></a> Out of place space?</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/81c6293f9228c78517e19e7801406dd0e5a22e0b"><code>81c6293</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/100">#100</a> from rusty-snake/patch-1</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/d49c3fd102ba16aa49012ff271e8fcb3d83db6fd"><code>d49c3fd</code></a> config.rs: docs: Add intra-doc links</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/568309c339f936ddf1defad1729a71feddb75a3a"><code>568309c</code></a> add demo for paris feature</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/40808ea9f585b0199368884d56eebfe30a7fcb79"><code>40808ea</code></a> fix the problem of macro hygiene when paris is enabled</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/cf8fc32c318c510afc40fec2d9bdcc8ec4590eed"><code>cf8fc32</code></a> fix TestLogger</li>
<li>Additional commits viewable in <a href="https://github.com/drakulix/simplelog.rs/compare/v0.11.0...v0.12.0">compare view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
bors bot added a commit to probe-rs/probe-rs that referenced this issue Apr 20, 2022
1085: build(deps): bump simplelog from 0.11.2 to 0.12.0 in /target-gen r=Tiwalun a=dependabot[bot]

Bumps [simplelog](https://github.com/drakulix/simplelog.rs) from 0.11.2 to 0.12.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/Drakulix/simplelog.rs/blob/master/CHANGELOG.md">simplelog's changelog</a>.</em></p>
<blockquote>
<h2>v0.12.0</h2>
<pre><code>- Replaces the semingly unmainted chrono library with the time crate.
- Addresses through this update 
    - RUSTSEC-2020-0159 (chrono)
    - RUSTSEC-2020-0071 (time)
- `ConfigBuilder::set_time_to_local` is replaced by `ConfigBuilder::set_time_offset_to_local`.
    - This function requires the new (and by default activated) `local-offset` feature.
    - This function may fail, for more information read the docs.
    - simplelog will not determine the local offset dynamically anymore, but only once, when this config option is set.
        - Due to safety reasons there is no way to provide this property currently.
- `ConfigBuilder::set_time_offset` now takes a `time::UtcOffset` instead of a `chrono::FixedOffset`.
- `ConfigBuilder::set_time_format` has been replaced by three new variants
    - `ConfigBuilder::set_time_format_rfc2822` sets the time format to use the format described by rfc2822.
    - `ConfigBuilder::set_time_format_rfc3339` sets the time format to use the format described by rfc3339.
    - `ConfigBuilder::set_time_format_custom` sets the time format to a custom time format best created using `time::macros::format_description`.
        - Runtime provided time format configuration is possible, but difficult due to lifetime constraints.
        - Fixing this will require a solution to time-rs/time#429
    - *Note*: The default format is unchanged &quot;[hour]:[minute]:[second]&quot;
</code></pre>
<h2>v0.11.0</h2>
<pre><code>- Add colored log levels using `ansi_term` (PR [#88](Drakulix/simplelog.rs#88), credits to `@manio)`
- Add target padding (PR [#85](Drakulix/simplelog.rs#85), credits to `@bytebeamio)`
- Add optional color and style support using `paris` crate (PR [#84](Drakulix/simplelog.rs#84), credits to `@manio)`
</code></pre>
<h2>v0.10.2</h2>
<pre><code>- Fix flushing with `BufferedStandardStreams` (PR [#82](Drakulix/simplelog.rs#82), credits to `@mrkline)`
</code></pre>
<h2>v0.10.1</h2>
<pre><code>- Fix TermLogger performance using `termcolor::BufferedStandardStream` (PR [#80](Drakulix/simplelog.rs#80), credits to `@mrkline)`
- Add write thread name support for `termlog` (PR [#76](Drakulix/simplelog.rs#76), credits to `@zeroflaw)`
</code></pre>
<h2>v0.10.0</h2>
<pre><code>- Fix wrong argument naming (PR [#70](Drakulix/simplelog.rs#70), credits to `@scvalex)`
- *Breaking*: More color customization options (PR [#72](Drakulix/simplelog.rs#72), credits to `@mrkline)`
- Clarify docs on config levels
</code></pre>
<h2>v0.9.0</h2>
<pre><code>- Add customizable level label colors (PR [#69](Drakulix/simplelog.rs#69). credits to `@JarrettBillingsley)`
- Remove unneeded TermLogError
- Future-proof config by adding `#[non_exhaustive]`
- Fix compiling with minimal-versions
</code></pre>
<h2>v0.8.0</h2>
<pre><code>- Switch from `term` to `termcolor` (PR [#59](Drakulix/simplelog.rs#59). credits to `@raybritton)`
- Fix typo in docs (PR [#58](Drakulix/simplelog.rs#58), credits to `@anthonyjmartinez)`
- Switch default padding to `Off`. Padding is annoyingly controversal, just set it to whatever you prefer, if you want it.
</code></pre>
<h2>v0.7.6</h2>
<pre><code>- Derive `Clone`,`Copy`,`PartialEq`,`Eq`,`Debug` and `Hash` for `TerminalMode`. (PR [#56](Drakulix/simplelog.rs#56), credits to `@panhania)`
</code></pre>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/95275c88b14f204a5e8278cd98072e4ffb0bc7d8"><code>95275c8</code></a> v0.12.0</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/f137eb4a2934faaec2d45652d14065f8560e5c49"><code>f137eb4</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/101">#101</a> from jacobtread/patch-1</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/ba172540f9e8eb0b31c65e43e234fe3cdc979ee6"><code>ba17254</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/99">#99</a> from zjp-CN/master</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/44a294fcff08818f5a8a889901508e62adb1bd29"><code>44a294f</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/95">#95</a> from Drakulix/fix/chrono_dep</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/d9257919d9e4afdf9d7385c4eb07f6031b6a17d9"><code>d925791</code></a> Out of place space?</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/81c6293f9228c78517e19e7801406dd0e5a22e0b"><code>81c6293</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/100">#100</a> from rusty-snake/patch-1</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/d49c3fd102ba16aa49012ff271e8fcb3d83db6fd"><code>d49c3fd</code></a> config.rs: docs: Add intra-doc links</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/568309c339f936ddf1defad1729a71feddb75a3a"><code>568309c</code></a> add demo for paris feature</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/40808ea9f585b0199368884d56eebfe30a7fcb79"><code>40808ea</code></a> fix the problem of macro hygiene when paris is enabled</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/cf8fc32c318c510afc40fec2d9bdcc8ec4590eed"><code>cf8fc32</code></a> fix TestLogger</li>
<li>Additional commits viewable in <a href="https://github.com/drakulix/simplelog.rs/compare/v0.11.2...v0.12.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=simplelog&package-manager=cargo&previous-version=0.11.2&new-version=0.12.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
bors bot added a commit to rust-corpus/qrates that referenced this issue Apr 21, 2022
217: Bump simplelog from 0.11.2 to 0.12.0 r=vakaras a=dependabot[bot]

Bumps [simplelog](https://github.com/drakulix/simplelog.rs) from 0.11.2 to 0.12.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/Drakulix/simplelog.rs/blob/master/CHANGELOG.md">simplelog's changelog</a>.</em></p>
<blockquote>
<h2>v0.12.0</h2>
<pre><code>- Replaces the semingly unmainted chrono library with the time crate.
- Addresses through this update 
    - RUSTSEC-2020-0159 (chrono)
    - RUSTSEC-2020-0071 (time)
- `ConfigBuilder::set_time_to_local` is replaced by `ConfigBuilder::set_time_offset_to_local`.
    - This function requires the new (and by default activated) `local-offset` feature.
    - This function may fail, for more information read the docs.
    - simplelog will not determine the local offset dynamically anymore, but only once, when this config option is set.
        - Due to safety reasons there is no way to provide this property currently.
- `ConfigBuilder::set_time_offset` now takes a `time::UtcOffset` instead of a `chrono::FixedOffset`.
- `ConfigBuilder::set_time_format` has been replaced by three new variants
    - `ConfigBuilder::set_time_format_rfc2822` sets the time format to use the format described by rfc2822.
    - `ConfigBuilder::set_time_format_rfc3339` sets the time format to use the format described by rfc3339.
    - `ConfigBuilder::set_time_format_custom` sets the time format to a custom time format best created using `time::macros::format_description`.
        - Runtime provided time format configuration is possible, but difficult due to lifetime constraints.
        - Fixing this will require a solution to time-rs/time#429
    - *Note*: The default format is unchanged &quot;[hour]:[minute]:[second]&quot;
</code></pre>
<h2>v0.11.0</h2>
<pre><code>- Add colored log levels using `ansi_term` (PR [#88](Drakulix/simplelog.rs#88), credits to `@manio)`
- Add target padding (PR [#85](Drakulix/simplelog.rs#85), credits to `@bytebeamio)`
- Add optional color and style support using `paris` crate (PR [#84](Drakulix/simplelog.rs#84), credits to `@manio)`
</code></pre>
<h2>v0.10.2</h2>
<pre><code>- Fix flushing with `BufferedStandardStreams` (PR [#82](Drakulix/simplelog.rs#82), credits to `@mrkline)`
</code></pre>
<h2>v0.10.1</h2>
<pre><code>- Fix TermLogger performance using `termcolor::BufferedStandardStream` (PR [#80](Drakulix/simplelog.rs#80), credits to `@mrkline)`
- Add write thread name support for `termlog` (PR [#76](Drakulix/simplelog.rs#76), credits to `@zeroflaw)`
</code></pre>
<h2>v0.10.0</h2>
<pre><code>- Fix wrong argument naming (PR [#70](Drakulix/simplelog.rs#70), credits to `@scvalex)`
- *Breaking*: More color customization options (PR [#72](Drakulix/simplelog.rs#72), credits to `@mrkline)`
- Clarify docs on config levels
</code></pre>
<h2>v0.9.0</h2>
<pre><code>- Add customizable level label colors (PR [#69](Drakulix/simplelog.rs#69). credits to `@JarrettBillingsley)`
- Remove unneeded TermLogError
- Future-proof config by adding `#[non_exhaustive]`
- Fix compiling with minimal-versions
</code></pre>
<h2>v0.8.0</h2>
<pre><code>- Switch from `term` to `termcolor` (PR [#59](Drakulix/simplelog.rs#59). credits to `@raybritton)`
- Fix typo in docs (PR [#58](Drakulix/simplelog.rs#58), credits to `@anthonyjmartinez)`
- Switch default padding to `Off`. Padding is annoyingly controversal, just set it to whatever you prefer, if you want it.
</code></pre>
<h2>v0.7.6</h2>
<pre><code>- Derive `Clone`,`Copy`,`PartialEq`,`Eq`,`Debug` and `Hash` for `TerminalMode`. (PR [#56](Drakulix/simplelog.rs#56), credits to `@panhania)`
</code></pre>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/95275c88b14f204a5e8278cd98072e4ffb0bc7d8"><code>95275c8</code></a> v0.12.0</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/f137eb4a2934faaec2d45652d14065f8560e5c49"><code>f137eb4</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/101">#101</a> from jacobtread/patch-1</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/ba172540f9e8eb0b31c65e43e234fe3cdc979ee6"><code>ba17254</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/99">#99</a> from zjp-CN/master</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/44a294fcff08818f5a8a889901508e62adb1bd29"><code>44a294f</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/95">#95</a> from Drakulix/fix/chrono_dep</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/d9257919d9e4afdf9d7385c4eb07f6031b6a17d9"><code>d925791</code></a> Out of place space?</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/81c6293f9228c78517e19e7801406dd0e5a22e0b"><code>81c6293</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/100">#100</a> from rusty-snake/patch-1</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/d49c3fd102ba16aa49012ff271e8fcb3d83db6fd"><code>d49c3fd</code></a> config.rs: docs: Add intra-doc links</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/568309c339f936ddf1defad1729a71feddb75a3a"><code>568309c</code></a> add demo for paris feature</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/40808ea9f585b0199368884d56eebfe30a7fcb79"><code>40808ea</code></a> fix the problem of macro hygiene when paris is enabled</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/cf8fc32c318c510afc40fec2d9bdcc8ec4590eed"><code>cf8fc32</code></a> fix TestLogger</li>
<li>Additional commits viewable in <a href="https://github.com/drakulix/simplelog.rs/compare/v0.11.2...v0.12.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=simplelog&package-manager=cargo&previous-version=0.11.2&new-version=0.12.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

221: Bump cargo from 0.60.0 to 0.61.0 r=vakaras a=dependabot[bot]

Bumps [cargo](https://github.com/rust-lang/cargo) from 0.60.0 to 0.61.0.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/rust-lang/cargo/commit/d1fd9fe2c40a1a56af9132b5c92ab963ac7ae422"><code>d1fd9fe</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/rust-lang/cargo/issues/10436">#10436</a> - cuviper:rust-1.60.0-config-verbosity, r=alexcrichton</li>
<li><a href="https://github.com/rust-lang/cargo/commit/6034981325f22adad46a2f94fd1c665fa7d7a2a1"><code>6034981</code></a> Fix term.verbose without quiet, and vice versa</li>
<li><a href="https://github.com/rust-lang/cargo/commit/1e5cac721024d00732ecd1133f40254b78af374f"><code>1e5cac7</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/rust-lang/cargo/issues/10413">#10413</a> - ehuss:beta-fix-rustflags-gate, r=alexcrichton</li>
<li><a href="https://github.com/rust-lang/cargo/commit/0ebfe2e30cd32452850c247b34719fa87a0a5b48"><code>0ebfe2e</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/rust-lang/cargo/issues/10396">#10396</a> - jonhoo:clap-deprecations, r=epage</li>
<li><a href="https://github.com/rust-lang/cargo/commit/ba955c5dbb84a83a00b54aacebaff3d2fc56ae1f"><code>ba955c5</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/rust-lang/cargo/issues/10411">#10411</a> - ehuss:fix-rustflags-gate, r=alexcrichton</li>
<li><a href="https://github.com/rust-lang/cargo/commit/ea2a21c994ca1e4d4c49412827b3cf4dcb158b1d"><code>ea2a21c</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/rust-lang/cargo/issues/10379">#10379</a> - weihanglo:issue-10370, r=alexcrichton</li>
<li><a href="https://github.com/rust-lang/cargo/commit/27c599c0cc9907fb88d89671ab730f2effa7dc83"><code>27c599c</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/rust-lang/cargo/issues/10385">#10385</a> - hi-rustin:rustin-patch-badge, r=alexcrichton</li>
<li><a href="https://github.com/rust-lang/cargo/commit/8fa412029261b163f356ac153a975c8758cf961a"><code>8fa4120</code></a> Add a badge for github actions</li>
<li><a href="https://github.com/rust-lang/cargo/commit/28fffd646aed48c790474644ee14b54ad97ac34d"><code>28fffd6</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/rust-lang/cargo/issues/10380">#10380</a> - hi-rustin:rustin-patch-badges, r=alexcrichton</li>
<li><a href="https://github.com/rust-lang/cargo/commit/d76449f52c447415bd104f250e66d9d6396cbdd7"><code>d76449f</code></a> Remove outdated badges</li>
<li>Additional commits viewable in <a href="https://github.com/rust-lang/cargo/compare/0.60.0...0.61.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cargo&package-manager=cargo&previous-version=0.60.0&new-version=0.61.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
bors bot added a commit to rust-corpus/qrates that referenced this issue Apr 21, 2022
217: Bump simplelog from 0.11.2 to 0.12.0 r=vakaras a=dependabot[bot]

Bumps [simplelog](https://github.com/drakulix/simplelog.rs) from 0.11.2 to 0.12.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/Drakulix/simplelog.rs/blob/master/CHANGELOG.md">simplelog's changelog</a>.</em></p>
<blockquote>
<h2>v0.12.0</h2>
<pre><code>- Replaces the semingly unmainted chrono library with the time crate.
- Addresses through this update 
    - RUSTSEC-2020-0159 (chrono)
    - RUSTSEC-2020-0071 (time)
- `ConfigBuilder::set_time_to_local` is replaced by `ConfigBuilder::set_time_offset_to_local`.
    - This function requires the new (and by default activated) `local-offset` feature.
    - This function may fail, for more information read the docs.
    - simplelog will not determine the local offset dynamically anymore, but only once, when this config option is set.
        - Due to safety reasons there is no way to provide this property currently.
- `ConfigBuilder::set_time_offset` now takes a `time::UtcOffset` instead of a `chrono::FixedOffset`.
- `ConfigBuilder::set_time_format` has been replaced by three new variants
    - `ConfigBuilder::set_time_format_rfc2822` sets the time format to use the format described by rfc2822.
    - `ConfigBuilder::set_time_format_rfc3339` sets the time format to use the format described by rfc3339.
    - `ConfigBuilder::set_time_format_custom` sets the time format to a custom time format best created using `time::macros::format_description`.
        - Runtime provided time format configuration is possible, but difficult due to lifetime constraints.
        - Fixing this will require a solution to time-rs/time#429
    - *Note*: The default format is unchanged &quot;[hour]:[minute]:[second]&quot;
</code></pre>
<h2>v0.11.0</h2>
<pre><code>- Add colored log levels using `ansi_term` (PR [#88](Drakulix/simplelog.rs#88), credits to `@manio)`
- Add target padding (PR [#85](Drakulix/simplelog.rs#85), credits to `@bytebeamio)`
- Add optional color and style support using `paris` crate (PR [#84](Drakulix/simplelog.rs#84), credits to `@manio)`
</code></pre>
<h2>v0.10.2</h2>
<pre><code>- Fix flushing with `BufferedStandardStreams` (PR [#82](Drakulix/simplelog.rs#82), credits to `@mrkline)`
</code></pre>
<h2>v0.10.1</h2>
<pre><code>- Fix TermLogger performance using `termcolor::BufferedStandardStream` (PR [#80](Drakulix/simplelog.rs#80), credits to `@mrkline)`
- Add write thread name support for `termlog` (PR [#76](Drakulix/simplelog.rs#76), credits to `@zeroflaw)`
</code></pre>
<h2>v0.10.0</h2>
<pre><code>- Fix wrong argument naming (PR [#70](Drakulix/simplelog.rs#70), credits to `@scvalex)`
- *Breaking*: More color customization options (PR [#72](Drakulix/simplelog.rs#72), credits to `@mrkline)`
- Clarify docs on config levels
</code></pre>
<h2>v0.9.0</h2>
<pre><code>- Add customizable level label colors (PR [#69](Drakulix/simplelog.rs#69). credits to `@JarrettBillingsley)`
- Remove unneeded TermLogError
- Future-proof config by adding `#[non_exhaustive]`
- Fix compiling with minimal-versions
</code></pre>
<h2>v0.8.0</h2>
<pre><code>- Switch from `term` to `termcolor` (PR [#59](Drakulix/simplelog.rs#59). credits to `@raybritton)`
- Fix typo in docs (PR [#58](Drakulix/simplelog.rs#58), credits to `@anthonyjmartinez)`
- Switch default padding to `Off`. Padding is annoyingly controversal, just set it to whatever you prefer, if you want it.
</code></pre>
<h2>v0.7.6</h2>
<pre><code>- Derive `Clone`,`Copy`,`PartialEq`,`Eq`,`Debug` and `Hash` for `TerminalMode`. (PR [#56](Drakulix/simplelog.rs#56), credits to `@panhania)`
</code></pre>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/95275c88b14f204a5e8278cd98072e4ffb0bc7d8"><code>95275c8</code></a> v0.12.0</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/f137eb4a2934faaec2d45652d14065f8560e5c49"><code>f137eb4</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/101">#101</a> from jacobtread/patch-1</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/ba172540f9e8eb0b31c65e43e234fe3cdc979ee6"><code>ba17254</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/99">#99</a> from zjp-CN/master</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/44a294fcff08818f5a8a889901508e62adb1bd29"><code>44a294f</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/95">#95</a> from Drakulix/fix/chrono_dep</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/d9257919d9e4afdf9d7385c4eb07f6031b6a17d9"><code>d925791</code></a> Out of place space?</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/81c6293f9228c78517e19e7801406dd0e5a22e0b"><code>81c6293</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/drakulix/simplelog.rs/issues/100">#100</a> from rusty-snake/patch-1</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/d49c3fd102ba16aa49012ff271e8fcb3d83db6fd"><code>d49c3fd</code></a> config.rs: docs: Add intra-doc links</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/568309c339f936ddf1defad1729a71feddb75a3a"><code>568309c</code></a> add demo for paris feature</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/40808ea9f585b0199368884d56eebfe30a7fcb79"><code>40808ea</code></a> fix the problem of macro hygiene when paris is enabled</li>
<li><a href="https://github.com/Drakulix/simplelog.rs/commit/cf8fc32c318c510afc40fec2d9bdcc8ec4590eed"><code>cf8fc32</code></a> fix TestLogger</li>
<li>Additional commits viewable in <a href="https://github.com/drakulix/simplelog.rs/compare/v0.11.2...v0.12.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=simplelog&package-manager=cargo&previous-version=0.11.2&new-version=0.12.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

221: Bump cargo from 0.60.0 to 0.61.0 r=vakaras a=dependabot[bot]

Bumps [cargo](https://github.com/rust-lang/cargo) from 0.60.0 to 0.61.0.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/rust-lang/cargo/commit/d1fd9fe2c40a1a56af9132b5c92ab963ac7ae422"><code>d1fd9fe</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/rust-lang/cargo/issues/10436">#10436</a> - cuviper:rust-1.60.0-config-verbosity, r=alexcrichton</li>
<li><a href="https://github.com/rust-lang/cargo/commit/6034981325f22adad46a2f94fd1c665fa7d7a2a1"><code>6034981</code></a> Fix term.verbose without quiet, and vice versa</li>
<li><a href="https://github.com/rust-lang/cargo/commit/1e5cac721024d00732ecd1133f40254b78af374f"><code>1e5cac7</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/rust-lang/cargo/issues/10413">#10413</a> - ehuss:beta-fix-rustflags-gate, r=alexcrichton</li>
<li><a href="https://github.com/rust-lang/cargo/commit/0ebfe2e30cd32452850c247b34719fa87a0a5b48"><code>0ebfe2e</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/rust-lang/cargo/issues/10396">#10396</a> - jonhoo:clap-deprecations, r=epage</li>
<li><a href="https://github.com/rust-lang/cargo/commit/ba955c5dbb84a83a00b54aacebaff3d2fc56ae1f"><code>ba955c5</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/rust-lang/cargo/issues/10411">#10411</a> - ehuss:fix-rustflags-gate, r=alexcrichton</li>
<li><a href="https://github.com/rust-lang/cargo/commit/ea2a21c994ca1e4d4c49412827b3cf4dcb158b1d"><code>ea2a21c</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/rust-lang/cargo/issues/10379">#10379</a> - weihanglo:issue-10370, r=alexcrichton</li>
<li><a href="https://github.com/rust-lang/cargo/commit/27c599c0cc9907fb88d89671ab730f2effa7dc83"><code>27c599c</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/rust-lang/cargo/issues/10385">#10385</a> - hi-rustin:rustin-patch-badge, r=alexcrichton</li>
<li><a href="https://github.com/rust-lang/cargo/commit/8fa412029261b163f356ac153a975c8758cf961a"><code>8fa4120</code></a> Add a badge for github actions</li>
<li><a href="https://github.com/rust-lang/cargo/commit/28fffd646aed48c790474644ee14b54ad97ac34d"><code>28fffd6</code></a> Auto merge of <a href="https://github-redirect.dependabot.com/rust-lang/cargo/issues/10380">#10380</a> - hi-rustin:rustin-patch-badges, r=alexcrichton</li>
<li><a href="https://github.com/rust-lang/cargo/commit/d76449f52c447415bd104f250e66d9d6396cbdd7"><code>d76449f</code></a> Remove outdated badges</li>
<li>Additional commits viewable in <a href="https://github.com/rust-lang/cargo/compare/0.60.0...0.61.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cargo&package-manager=cargo&previous-version=0.60.0&new-version=0.61.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@jhpratt
Copy link
Member

jhpratt commented Nov 3, 2022

I have just implemented this on main.

@jhpratt jhpratt closed this as completed Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-format-description Area: format description C-feature-request Category: a new feature (not already implemented)
Projects
None yet
Development

No branches or pull requests

2 participants