Files
Desktop_RCULogAgent/bin/aliyun-log-csharp-sdk-master/SLSSDK/Data/LogItem.cs
2025-12-11 11:39:02 +08:00

68 lines
1.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* Copyright (C) Alibaba Cloud Computing
* All rights reserved.
*
* 版权所有 C阿里云计算有限公司
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace Aliyun.Api.LOG.Data
{
/// <summary>
/// This class presents one log event item that will put into SLS
/// </summary>
public class LogItem
{
private UInt32 _time;
private List<LogContent> _contents;
/// <summary>
/// the log's timestamp
/// </summary>
public UInt32 Time
{
get { return _time; }
set { _time = value; }
}
/// <summary>
/// logcontents in logs
/// </summary>
public List<LogContent> Contents
{
get { return _contents; }
set { _contents = value; }
}
/// <summary>
/// default constructor
/// </summary>
public LogItem()
{
_contents = new List<LogContent>();
}
/// <summary>
/// method to append log content by key/value pair
/// </summary>
/// <param name="key">user define field to name the value</param>
/// <param name="value">the value of field key</param>
public void PushBack(String key, String value)
{
_contents.Add(new LogContent(key, value));
}
/// <summary>
/// method to append log content by key/value pair
/// </summary>
/// <param name="content">log content</param>
public void PushBack(LogContent content)
{
_contents.Add(content);
}
}
}