init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
182
Framework/Logging/LogMessage.cs
Normal file
182
Framework/Logging/LogMessage.cs
Normal file
|
@ -0,0 +1,182 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace Kreta.Framework.Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// Az <see cref="ILogMessage"/> interfész alapértelmezett implementációja
|
||||
/// </summary>
|
||||
public class LogMessage : ILogMessage
|
||||
{
|
||||
private string m_LogEntryId;
|
||||
private Events m_EventType = 0;
|
||||
private string m_SessionId = "";
|
||||
private LogLevel m_Level;
|
||||
private Hashtable m_Parameters = new Hashtable();
|
||||
private string m_UserId;
|
||||
private bool m_IsLogged;
|
||||
int? intezmenyid; // TODO: kezelni értelmesen
|
||||
int? tanevid; // TODO: kezelni értelmesen
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály alapértelmezett konstruktora.
|
||||
/// </summary>
|
||||
public LogMessage()
|
||||
: this(Guid.NewGuid().ToString())
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az osztály konstruktora.
|
||||
/// </summary>
|
||||
/// <param name="logEntryId">A bejegyzés azonosítója</param>
|
||||
internal LogMessage(string logEntryId)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(logEntryId))
|
||||
{
|
||||
logEntryId = Guid.NewGuid().ToString();
|
||||
}
|
||||
m_LogEntryId = logEntryId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="ILogMessage"/>
|
||||
/// </summary>
|
||||
public string LogEntryId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_LogEntryId;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="ILogMessage"/>
|
||||
/// </summary>
|
||||
public Events EventType
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_EventType;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_EventType = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="ILogMessage"/>
|
||||
/// </summary>
|
||||
public LogLevel Level
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_Level;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_Level = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="ILogMessage"/>
|
||||
/// </summary>
|
||||
public string SessionId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.m_SessionId;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.m_SessionId = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A felhasználó azonosítója.
|
||||
/// </summary>
|
||||
public string UserId
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_UserId;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_UserId = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A bejegyzés naplóba lett-e már írva, vagy sem.
|
||||
/// </summary>
|
||||
public bool IsLogged
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_IsLogged;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_IsLogged = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az üzenet paraméterei.
|
||||
/// </summary>
|
||||
public IDictionary Parameters
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Parameters;
|
||||
}
|
||||
}
|
||||
|
||||
public int? IntezmenyId
|
||||
{
|
||||
get
|
||||
{
|
||||
return intezmenyid;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.intezmenyid = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int? TanevId
|
||||
{
|
||||
get
|
||||
{
|
||||
return tanevid;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.tanevid = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Beállítja egy paraméter értékét.
|
||||
/// </summary>
|
||||
/// <param name="parameterName">A paraméter típusa</param>
|
||||
/// <param name="value">A paraméter értéke</param>
|
||||
public void SetParameter(LogParameter parameterName, object value)
|
||||
{
|
||||
this.m_Parameters[parameterName] = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lásd <see cref="IEnumerable.GetEnumerator"/>.
|
||||
/// </summary>
|
||||
/// <returns>Lásd <see cref="IEnumerable.GetEnumerator"/></returns>
|
||||
public IEnumerator GetEnumerator()
|
||||
{
|
||||
return m_Parameters.GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue