~~NOTOC~~
[[log_management_api]] > [[BS2_GetLogBlob]]
----
===== BS2_GetLogBlob=====
EventMask에 맞게 일정량의 로그를 가져옵니다.
==== 함수 ====
#include "BS_API.h"
int BS2_GetLogBlob(void* context, uint32_t deviceId, uint16_t eventMask, uint32_t eventId, uint32_t amount, BS2EventBlob** logsObj, uint32_t* numLog);
[[Log_Management_API#BS2EventBlob|BS2EventBlob구조체 보기]]
==== 파라미터 ====
* [In] ''//context//'' : Context
* [In] ''//deviceId//'' : 장치 식별자
* [In] ''//eventMask//'' : event mask
* [In] ''//eventId//'' : 로그 레코드 ID이며, 0일 경우 처음부터 가져옵니다.
* [In] ''//amount//'' : 최대 로그 레코드 갯수이며, 0일 경우 eventId 이후 모든 레코드를 가져옵니다.
* [Out] ''//logsObj//'' : 로그 레코드의 주소를 저장할 포인터
* [Out] ''//numLog//'' : 로그 레코드의 갯수
**참고**\\
logsObj 변수는 사용한 뒤 [[BS2_ReleaseObject]] 함수를 이용해 시스템에 메모리를 반환해야 합니다.
==== 반환값 ====
성공적으로 수행될 경우 ''BS_SDK_SUCCESS''를 반환하고, 에러가 발생할 경우 상응하는 에러 코드를 반환합니다.
==== 샘플코드 ====
C#
UInt32 lastEventId = 0;
UInt32 amount;
IntPtr outEventLogObjs = IntPtr.Zero;
UInt32 outNumEventLogs = 0;
cbOnLogReceived = new API.OnLogReceived(NormalLogReceived);
lastEventId = Util.GetInput((UInt32)0);
outEventLogObjs = IntPtr.Zero;
BS2ErrorCode result = (BS2ErrorCode)API.BS2_GetLogBlob(sdkContext, deviceID, (ushort)BS2EventMaskEnum.ALL, lastEventId, amount, out outEventLogObjs, out outNumEventLogs);
if (result != BS2ErrorCode.BS_SDK_SUCCESS)
{
Console.WriteLine("Got error({0}).", result);
break;
}
==== 함께 보기 ====
[[BS2_GetLog]]\\ [[BS2_GetFilteredLog]]\\ [[BS2_ClearLog]]