mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-05 13:02:44 +13:00
Fix datetime format in HISPd
This commit is contained in:
parent
245f2d3e48
commit
239f12cdc1
5 changed files with 13 additions and 14 deletions
|
@ -74,7 +74,7 @@ namespace HISP.Cli
|
|||
shutdownHandle.Set();
|
||||
}
|
||||
|
||||
private static string formatMessage(string type, string text)
|
||||
private static string formatMessage(string type, string text, bool console)
|
||||
{
|
||||
#if OS_WINDOWS
|
||||
string newline = "\r\n";
|
||||
|
@ -82,9 +82,8 @@ namespace HISP.Cli
|
|||
string newline = "\n";
|
||||
#endif
|
||||
|
||||
string msg = DateTime.Now.ToString("MM dd yyyy HH:mm:dd") + ": [" + type + "] ";
|
||||
|
||||
if (text.Length > (Console.WindowWidth - msg.Length) - newline.Length)
|
||||
string msg = DateTime.Now.ToString("MM-dd-yyyy HH:mm:ss") + ": [" + type + "] ";
|
||||
if (console && text.Length > (Console.WindowWidth - msg.Length) - newline.Length)
|
||||
text = text.Substring(0, (Console.WindowWidth - msg.Length) - newline.Length);
|
||||
|
||||
return msg + text + newline;
|
||||
|
@ -92,7 +91,7 @@ namespace HISP.Cli
|
|||
|
||||
public static void LogToFile(bool error, string type,string text)
|
||||
{
|
||||
sw.WriteLine(formatMessage(type, text));
|
||||
sw.WriteLine(formatMessage(type, text, false));
|
||||
if (error)
|
||||
sw.Flush();
|
||||
}
|
||||
|
@ -103,9 +102,9 @@ namespace HISP.Cli
|
|||
try
|
||||
{
|
||||
if (error)
|
||||
Console.Error.WriteAsync(formatMessage(type, text));
|
||||
Console.Error.WriteAsync(formatMessage(type, text, true));
|
||||
else
|
||||
Console.Out.WriteAsync(formatMessage(type, text));
|
||||
Console.Out.WriteAsync(formatMessage(type, text, true));
|
||||
|
||||
}
|
||||
catch (Exception) { };
|
||||
|
|
|
@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.8.61.0")]
|
||||
[assembly: AssemblyFileVersion("1.8.61.0")]
|
||||
[assembly: AssemblyVersion("1.8.62.0")]
|
||||
[assembly: AssemblyFileVersion("1.8.62.0")]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Package: hisp
|
||||
Version: 1.8.61
|
||||
Version: 1.8.62
|
||||
Depends: coreutils,systemd,mariadb-server,libsqlite3-dev,zlib1g-dev,libicu-dev,libkrb5-dev
|
||||
Maintainer: Li
|
||||
Homepage: https://islehorse.com
|
||||
|
|
|
@ -30,8 +30,8 @@ using System.Runtime.InteropServices;
|
|||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.8.61.0")]
|
||||
[assembly: AssemblyFileVersion("1.8.61.0")]
|
||||
[assembly: AssemblyVersion("1.8.62.0")]
|
||||
[assembly: AssemblyFileVersion("1.8.62.0")]
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ using System.Runtime.InteropServices;
|
|||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.8.61.0")]
|
||||
[assembly: AssemblyFileVersion("1.8.61.0")]
|
||||
[assembly: AssemblyVersion("1.8.62.0")]
|
||||
[assembly: AssemblyFileVersion("1.8.62.0")]
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue