mirror of
https://gitee.com/xiarenalofs/squad-rain-ops-mini.git
synced 2026-08-06 13:26:25 +08:00
40 lines
897 B
C#
40 lines
897 B
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Configuration;
|
||
using System.IO;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace RainOpsMini.Helpers
|
||
{
|
||
/// <summary>
|
||
/// 单体日志输出工具
|
||
/// </summary>
|
||
public class RainOpsLog
|
||
{
|
||
|
||
/// <summary>
|
||
/// 业务锁防止文件被多次占用
|
||
/// </summary>
|
||
static readonly object objSync = new object();
|
||
|
||
/// <summary>
|
||
/// 输出日志
|
||
/// </summary>
|
||
/// <param name="content">日志内容</param>
|
||
public static void Log(string content)
|
||
{
|
||
|
||
lock (objSync)
|
||
{
|
||
//日志内容自动换行
|
||
content = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffff") + ":" + content + "\r\n";
|
||
Console.Write(content);
|
||
}
|
||
}
|
||
|
||
|
||
}
|
||
}
|