本文整理汇总了C#中LogEntryType类的典型用法代码示例。如果您正苦于以下问题:C# LogEntryType类的具体用法?C# LogEntryType怎么用?C# LogEntryType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LogEntryType类属于命名空间,在下文中一共展示了LogEntryType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: LogEntry
public LogEntry(DateTime logTime, string entryId, string message, LogEntryType type)
{
LogTime = logTime;
EntryId = entryId;
Message = message;
Type = type;
}
开发者ID:piscisaureus,项目名称:kudu,代码行数:7,代码来源:LogEntry.cs
示例2: GetLogEntries
public static IEnumerable<LogEntry> GetLogEntries(LogEntryType filterLevel)
{
lock (LogEntryList)
{
return LogEntryList.Where(x => x.Type.CompareTo(filterLevel) >= 0).ToArray();
}
}
开发者ID:Klocman,项目名称:MSREG,代码行数:7,代码来源:AppLog.cs
示例3: WriteLine
public void WriteLine(LogEntryType logEntryType, String message)
{
/* Timestamps are represented in the Round Trip Format Specifier
(http://msdn.microsoft.com/en-us/library/az4se3k1.aspx#Roundtrip). */
var timestamp = DateTime.Now.ToUniversalTime().ToString("o");
String type;
switch (logEntryType)
{
case LogEntryType.Info:
type = "INF";
break;
case LogEntryType.Warning:
type = "WRN";
break;
case LogEntryType.Error:
type = "ERR";
break;
default:
type = "UNK";
break;
}
this._writer.WriteLine(String.Format("{0} - {1} - {2}", timestamp, type, message));
}
开发者ID:ctimmons,项目名称:cs_utilities,代码行数:25,代码来源:Log.cs
示例4: LogEntry
/// <summary>
/// Initializes a new instance of LogEntry with username, message and log entry type.
/// </summary>
/// <param name="userName">Username who generated the log entry.</param>
/// <param name="message">Message associated with the log entry.</param>
/// <param name="entryType">Type of log entry.</param>
public LogEntry(string userName, string message, LogEntryType entryType)
{
this._TimwGenerated = DateTime.Now;
this._UserName = userName;
this._Message = message;
this._EntryType = entryType;
}
开发者ID:kami-,项目名称:Prizet,代码行数:13,代码来源:LogEntry.cs
示例5: MonitorBinaryFileOutput
void IActivityMonitorBoundClient.SetMonitor( IActivityMonitorImpl source, bool forceBuggyRemove )
{
if( source != null && _source != null ) throw ActivityMonitorClient.CreateMultipleRegisterOnBoundClientException( this );
// Silently ignore null => null or monitor => same monitor.
if( source != _source )
{
_prevLogType = LogEntryType.None;
_prevlogTime = DateTimeStamp.Unknown;
Debug.Assert( (source == null) != (_source == null) );
if( (_source = source) == null )
{
if( _file != null ) _file.Close();
_file = null;
}
else
{
// If initialization failed, we let the file null: this monitor will not
// work (the error will appear in the Critical errors) but this avoids
// an exception to be thrown here.
var f = new MonitorBinaryFileOutput( _path, ((IUniqueId)_source).UniqueId, _maxCountPerFile, _useGzipCompression );
if( f.Initialize( new SystemActivityMonitor( false, null ) ) )
{
var g = _source.CurrentGroup;
_currentGroupDepth = g != null ? g.Depth : 0;
_file = f;
}
}
}
}
开发者ID:Invenietis,项目名称:ck-core,代码行数:29,代码来源:CKMonWriterClient.cs
示例6: ActivityLogEntry
public ActivityLogEntry(string Message, long msTime)
{
m_Timestamp = DateTime.Now;
m_Type = LogEntryType.Timing;
m_Msg = Message;
m_Ref = msTime;
}
开发者ID:norrislabs,项目名称:EmergeStudio,代码行数:7,代码来源:ActivityLogEntry.cs
示例7: LogMessageToTextFile
private static int LogMessageToTextFile(LogEntryType type, string message)
{
try
{
string logmsg = "----------------------------\r\n" + //separator for new log
"Local time: " + DateTime.Now.ToString() + "\r\n" + //local time
//summary info
"Application Name: " + applicationName + "\r\n" +
"Log Type: " + type.ToString() + "\r\n" +
"Error Message:\r\n" + message + "\r\n";
//allow error log to be encoded by local time
string logFileName = string.Format(errorLogFileName, DateTime.Now);
using (StreamWriter w = File.AppendText(logFileName))
{
w.Write(logmsg);
}
return 0; //logged to local file
}
catch (Exception e)
{
//ignore errors, avoid infinite loop of trying to log errors
#if DEBUG
System.Console.WriteLine(e.ToString());
System.Diagnostics.Debug.WriteLine(e.ToString());
#endif
return -1;
}
}
开发者ID:huguogang,项目名称:Modem.NET,代码行数:32,代码来源:MessageLog.cs
示例8: Log
public static void Log(LogEntryType type, LogActionType action, string log, string metadata)
{
WriteLog($"LogEntryType: {type}\n" +
$"LogActionType : {action}\n" +
$"Log : {log}\n" +
$"Metadata : {metadata}");
}
开发者ID:AbabeiAndrei,项目名称:WProject,代码行数:7,代码来源:DiagnosticLogger.cs
示例9: LogEntry
public LogEntry(DateTime logTime, string id, string message, LogEntryType type)
{
LogTime = logTime;
Id = id;
Message = message;
Type = type;
}
开发者ID:EmmaZhu,项目名称:azure-sdk-tools,代码行数:7,代码来源:LogEntry.cs
示例10: LogEntry
internal LogEntry (LogEntryType type, string message, string details)
{
this.type = type;
this.message = message;
this.details = details;
this.timestamp = DateTime.Now;
}
开发者ID:rubenv,项目名称:tripod,代码行数:7,代码来源:Log.cs
示例11: LEMCLog
public LEMCLog( Guid monitorId, int depth, DateTimeStamp previousLogTime, LogEntryType previousEntryType, string text, DateTimeStamp t, string fileName, int lineNumber, LogLevel l, CKTrait tags, CKExceptionData ex )
: base( text, t, fileName, lineNumber, l, tags, ex )
{
_monitorId = monitorId;
_depth = depth;
_previousEntryType = previousEntryType;
_previousLogTime = previousLogTime;
}
开发者ID:Invenietis,项目名称:ck-core,代码行数:8,代码来源:LEMCLog.cs
示例12: LogEntry
public LogEntry(TimeSpan loggedTotalWorldTime, ILoggable loggable, LogEntryType entryType, TimeSpan logEntryLifetime)
{
_loggedTotalWorldTime = loggedTotalWorldTime;
_entryType = entryType;
_title = loggable.Title;
_details = loggable.Details.ToArray();
_fadeHelper = new TimedLerpHelper(loggedTotalWorldTime + logEntryLifetime - Constants.LogRenderer.FadeDuration, Constants.LogRenderer.FadeDuration, 1f, 0f);
}
开发者ID:tj-miller,项目名称:TextAdventure,代码行数:8,代码来源:LogEntry.cs
示例13: Custom
public void Custom(LogEntryType type, string message, Exception exception = null)
{
lock (writeLock)
{
writer.WriteLine("{0}: {1}", type.ToString().ToUpper(), message);
WriteException(exception);
}
}
开发者ID:yonglehou,项目名称:SharpRPC,代码行数:8,代码来源:FileLogger.cs
示例14: LEMCCloseGroup
public LEMCCloseGroup( Guid monitorId, int depth, DateTimeStamp previousLogTime, LogEntryType previousEntryType, DateTimeStamp t, LogLevel level, IReadOnlyList<ActivityLogGroupConclusion> c )
: base( t, level, c )
{
_monitorId = monitorId;
_depth = depth;
_previousEntryType = previousEntryType;
_previousLogTime = previousLogTime;
}
开发者ID:Invenietis,项目名称:ck-core,代码行数:8,代码来源:LEMCCloseGroup.cs
示例15: LogEntry
/// <summary>
/// Initializes a new instance of a log entry
/// </summary>
/// <param name="id">The unique id for this entry</param>
/// <param name="type">The log entry type</param>
/// <param name="message">The message to be logged</param>
/// <param name="logTime">The log time.</param>
/// <param name="exception">The exception information to be logged</param>
public LogEntry(int id, LogEntryType type, string message, DateTime logTime, Exception exception = null)
{
Id = id;
Type = type;
Message = message;
Exception = exception != null ? new ExceptionEntry(exception) : null;
LogTime = logTime;
}
开发者ID:ayezutov,项目名称:NDistribUnit,代码行数:16,代码来源:LogEntry.cs
示例16: LoggerEventArgs
/// <summary>
/// Initializes a new instance of this type.
/// </summary>
/// <param name="entryType">The type of the log-entry.</param>
/// <param name="eventId">A unique ID for this event.</param>
/// <param name="message">The complete message which was logged.</param>
/// <param name="sourceFile">The file from which the log was triggered.</param>
/// <param name="sourceLineNumber">The line-number inside the <paramref name="sourceFile"/> from which the log was triggered.</param>
/// <param name="sourceMethodName">The method-name inside the <paramref name="sourceFile"/> from which the log was triggered.</param>
public LoggerEventArgs(LogEntryType entryType, string eventId, string message, string sourceFile, int sourceLineNumber, string sourceMethodName)
{
EntryType = entryType;
Message = message;
SourceFile = sourceFile;
SourceLineNumber = sourceLineNumber;
SourceMethodName = sourceMethodName;
EventId = eventId;
}
开发者ID:codingfreak,项目名称:cfUtils,代码行数:18,代码来源:LoggerEventArgs.cs
示例17: LogEntry
/// <summary>
/// Default constructor.
/// </summary>
/// <param name="type">Log entry type.</param>
/// <param name="id">Log entry ID.</param>
/// <param name="size">Specified how much data was readed or written.</param>
/// <param name="text">Description text.</param>
public LogEntry(LogEntryType type, string id, long size, string text)
{
m_Type = type;
m_ID = id;
m_Size = size;
m_Text = text;
m_Time = DateTime.Now;
}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:16,代码来源:LogEntry.cs
示例18: Logger
public Logger(string logFileName, LogEntryType maxErrorLevel)
{
_logFileName = logFileName;
_maxErrorLevel = maxErrorLevel;
var sw = new StreamWriter(_logFileName, false);
sw.WriteLine("Application log started at " + DateTime.Now.ToString("dd/MM/YYYY HH:mm:ss\r\n"));
sw.Flush();
sw.Close();
}
开发者ID:xorkrus,项目名称:vk_wm,代码行数:10,代码来源:Logger.cs
示例19: Log
public ILogger Log(string value, LogEntryType type)
{
IDeploymentStatusFile statusFile = _status.Open(_id);
if (statusFile != null)
{
statusFile.UpdateProgress(value);
}
// No need to wrap this as we only support top-level progress
return _innerLogger.Log(value, type);
}
开发者ID:40a,项目名称:kudu,代码行数:11,代码来源:ProgressLogger.cs
示例20: Log
public void Log(string value, LogEntryType type)
{
XDocument document = GetDocument();
document.Root.Add(new XElement("entry",
new XAttribute("time", DateTime.Now),
new XAttribute("type", (int)type),
value));
document.Save(_path);
}
开发者ID:nulltoken,项目名称:kudu,代码行数:11,代码来源:XmlLogger.cs
注:本文中的LogEntryType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论