-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: tison <[email protected]>
- Loading branch information
Showing
3 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,8 @@ pub struct Metadata { | |
pub authors: Cow<'static, str>, | ||
/// The URL of the crate's website | ||
pub homepage: Cow<'static, str>, | ||
/// The support information | ||
pub supports: Cow<'static, str>, | ||
} | ||
|
||
/// Initialize [`Metadata`] | ||
|
@@ -75,6 +77,7 @@ macro_rules! metadata { | |
name: env!("CARGO_PKG_NAME").into(), | ||
authors: env!("CARGO_PKG_AUTHORS").replace(":", ", ").into(), | ||
homepage: env!("CARGO_PKG_HOMEPAGE").into(), | ||
supports: Default::default(), | ||
} | ||
}}; | ||
} | ||
|
@@ -98,7 +101,8 @@ macro_rules! metadata { | |
/// name: env!("CARGO_PKG_NAME").into(), | ||
/// version: env!("CARGO_PKG_VERSION").into(), | ||
/// authors: "My Company Support <[email protected]>".into(), | ||
/// homepage: "support.mycompany.com".into(), | ||
/// homepage: "www.mycompany.com".into(), | ||
/// supports: "- Open a support request by email to [email protected]".into(), | ||
/// }); | ||
/// ``` | ||
#[macro_export] | ||
|
@@ -180,8 +184,13 @@ fn write_msg<P: AsRef<Path>>( | |
file_path: Option<P>, | ||
meta: &Metadata, | ||
) -> IoResult<()> { | ||
let (_version, name, authors, homepage) = | ||
(&meta.version, &meta.name, &meta.authors, &meta.homepage); | ||
let Metadata { | ||
name, | ||
authors, | ||
homepage, | ||
supports, | ||
.. | ||
} = meta; | ||
|
||
writeln!(buffer, "Well, this is embarrassing.\n")?; | ||
writeln!( | ||
|
@@ -207,6 +216,9 @@ fn write_msg<P: AsRef<Path>>( | |
if !authors.is_empty() { | ||
writeln!(buffer, "- Authors: {authors}")?; | ||
} | ||
if !supports.is_empty() { | ||
writeln!(buffer, "\nTo submit the crash report:\n\n{supports}")?; | ||
} | ||
writeln!( | ||
buffer, | ||
"\nWe take privacy seriously, and do not perform any \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ fn main() { | |
version: env!("CARGO_PKG_VERSION").into(), | ||
authors: "My Company Support <[email protected]".into(), | ||
homepage: "support.mycompany.com".into(), | ||
supports: "- Open a support request by email to [email protected]".into() | ||
}); | ||
|
||
println!("A normal log message"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,10 @@ We have generated a report file at \"[..].toml\". Submit an issue or email with | |
- Homepage: support.mycompany.com | ||
- Authors: My Company Support <[email protected] | ||
To submit the crash report: | ||
- Open a support request by email to [email protected] | ||
We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports. | ||
Thank you kindly! | ||
|