mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
Ruby: serialize timestamps as ISO8601
This commit is contained in:
BIN
ruby/Cargo.lock
generated
BIN
ruby/Cargo.lock
generated
Binary file not shown.
@@ -22,3 +22,4 @@ encoding = "0.2"
|
||||
lazy_static = "1.4.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
chrono = { version = "0.4.19", features = ["serde"] }
|
||||
|
||||
@@ -56,7 +56,7 @@ pub struct Location {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct DiagnosticMessage {
|
||||
/** Unix timestamp */
|
||||
pub timestamp: u64,
|
||||
pub timestamp: chrono::DateTime<chrono::Utc>,
|
||||
pub source: Source,
|
||||
#[serde(skip_serializing_if = "String::is_empty")]
|
||||
/** GitHub flavored Markdown formatted message. Should include inline links to any help pages. */
|
||||
@@ -90,10 +90,7 @@ pub struct LogWriter {
|
||||
impl LogWriter {
|
||||
pub fn message(&self, id: &str, name: &str) -> DiagnosticMessage {
|
||||
DiagnosticMessage {
|
||||
timestamp: std::time::SystemTime::now()
|
||||
.duration_since(std::time::UNIX_EPOCH)
|
||||
.expect("")
|
||||
.as_millis() as u64,
|
||||
timestamp: chrono::Utc::now(),
|
||||
source: Source {
|
||||
id: format!("{}/{}", self.extractor, id),
|
||||
name: name.to_owned(),
|
||||
|
||||
Reference in New Issue
Block a user