mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-21 09:35:39 -05:00
Feature/timestamp messages (#68)
* added support for timestamps * fixed tests * Moved message class to own file; added 'z' to end of date strings * added default time constructor * removed unnecessary z * added time string format info in comment * changed from utc time to using local time
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts
|
||||
{
|
||||
/// <summary>
|
||||
/// Result message object with timestamp and actual message
|
||||
/// </summary>
|
||||
public class ResultMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Timestamp of the message
|
||||
/// Stored in UTC ISO 8601 format; should be localized before displaying to any user
|
||||
/// </summary>
|
||||
public string Time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Message contents
|
||||
/// </summary>
|
||||
public string Message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Full constructor
|
||||
/// </summary>
|
||||
public ResultMessage(string timeStamp, string message)
|
||||
{
|
||||
Time = timeStamp;
|
||||
Message = message;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with default "Now" time
|
||||
/// </summary>
|
||||
public ResultMessage(string message)
|
||||
{
|
||||
Time = DateTime.Now.ToString("o");
|
||||
Message = message;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user