当前位置: 首页>>代码示例>>C#>>正文


C# NLogEx.LoggerEx.Debug方法代码示例

本文整理汇总了C#中NLogEx.LoggerEx.Debug方法的典型用法代码示例。如果您正苦于以下问题:C# NLogEx.LoggerEx.Debug方法的具体用法?C# NLogEx.LoggerEx.Debug怎么用?C# NLogEx.LoggerEx.Debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NLogEx.LoggerEx的用法示例。


在下文中一共展示了NLogEx.LoggerEx.Debug方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: namePipeDataCheck_Elapsed

        //private FileStream fs = new FileStream(@"D:\cgwVideoAfter3.264", FileMode.OpenOrCreate, FileAccess.Write, FileShare.None);
        //private int wCount = 0;
        void namePipeDataCheck_Elapsed(object sender, ElapsedEventArgs e)
        {
            //namedPipeHasVideoDataTimer.Enabled = false;
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            try
            {
                //uint compareSize = mediaData.Size;
                uint compareSize = mediaDataSize;
                Thread.Sleep(1500);
                //uint size = mediaData.Size;

                uint size = mediaDataSize;

                //if (compareSize != size && mediaData.Size != 0)
                if(compareSize!=size && size!=0)
                {
                    iCount = 0;
                }
                else
                {
                    iCount++;
                }
                if (iCount == iNullCount)
                {
                    logEx.Debug("VideoPipe.Timer Data end,iCount={0},cameraNo={1}.", iCount,cameraNo);
                    namedPipeHasVideoDataTimer.Enabled = false;
                    logEx.Info("STOP namedPipeHasVideoDataTimer.");
                    VideoPipeManage.Instance().DeleteVideoPipe(cameraNo);
                    Stop();
                    VideoPipeManage.Instance().DeleteNoDataVideoPipe(cameraNo);
                }
                //else
                //{
                //    namedPipeHasVideoDataTimer.Enabled = true;
                //}
            }
            catch (System.Exception ex)
            {
                logEx.Error("VideoPipe.Timer.delete(cameraNo{0}) catch() failed ,ex={1}", cameraNo, ex.ToString());
            }
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:43,代码来源:VideoPipe.cs

示例2: GetAllCamerasMethod


//.........这里部分代码省略.........
                logEx.Trace("GetElteCameras groupListTemp:{0}", groupListTemp.Count);

                //获取摄像头和组之间的关联
                GetCameraAndGroupRelation(cameraListTemp, groupListTemp, nodeRelationListTemp);

                ////增加组外的设备信息
                //List<eLTEUserInfo> dcUsersList = new List<eLTEUserInfo>();
                ////获得本DC管理的所有User
                //lteSdkClient.GetAllDcUsers(0, out dcUsersList);

                foreach (eLTEUserInfo userInfo in dcUsersList)
                {
                    if ((userInfo.usercategory == eLTEUser_Category_t.PTTUSER && bPttUser) ||
                                (userInfo.usercategory == eLTEUser_Category_t.FIXEDCAMERA && bFixedCamera))
                    {
                        if (cameraListTemp.Exists(x => x.No == userInfo.userid.ToString()))
                        {
                            continue;
                        }
                        else
                        {
                            Camera camera = new Camera(userInfo.userid.ToString(), userInfo.username);

                            try
                            {
                                if (this.cameraStatusOperateLock.TryEnterReadLock(CgwConst.ENTER_LOCK_WAIT_TIME))
                                {
                                    camera.Status = onlineUser.Exists((x) =>
                                    {
                                        if (x == camera.No)
                                        {
                                            return true;
                                        }
                                        else
                                        {
                                            return false;
                                        }
                                    }) == true ? CameraStatus.Online : CameraStatus.Offline;
                                }
                                cameraListTemp.Add(camera);
                            }
                            finally
                            {
                                this.cameraStatusOperateLock.ExitReadLock();
                            }

                            List<string> pathList = new List<string>();
                            NodeRelation nodeRelation = new NodeRelation(camera.No, pathList, NodeType.CAMERA);
                            nodeRelationListTemp.Add(nodeRelation);
                        }
                    }
                }

                DateTime dtStart = DateTime.Now;
                DateTime dtNow = new DateTime();
                while (!isGetDevicesFinish)
                {
                    dtNow = DateTime.Now;

                    if ((dtNow - dtStart).TotalSeconds > refreshDeviceListOverTime)
                    {
                        isRefreshSuccess = false;
                        return;
                    }
                    Thread.Sleep(1);
                    continue;
                }

                //将实时获取的值放到缓存
                if (this.cameraOperateLock.TryEnterWriteLock(CgwConst.ENTER_LOCK_WAIT_TIME))
                {
                    try
                    {
                        this.cameraList = cameraListTemp;
                        this.groupList = groupListTemp;
                        this.nodeRelationList = nodeRelationListTemp;

                        isRefreshSuccess = true;
                    }
                    catch (Exception ex)
                    {
                        isRefreshSuccess = false;
                        logEx.Error("Set the list to the buffer failed. ", ex.Message);
                    }
                    finally
                    {
                        this.cameraOperateLock.ExitWriteLock();
                    }
                }
            }
            catch (System.Exception ex)
            {
                isRefreshSuccess = false;
                logEx.Error("GetAllCamerasMethod failed.Exception message:{0}", ex.Message);
            }

            logEx.Debug("GetAllCameras eLTE cameraList:{0}", cameraList.Count);
            logEx.Debug("GetAllCameras eLTE groupList:{0}", groupList.Count);
            logEx.Debug("GetAllCameras eLTE nodeRelationList:{0}", nodeRelationList.Count);
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:101,代码来源:eLTEVideoMonitor.cs

示例3: Stop

        ///// <summary>
        ///// 回调函数
        ///// </summary>
        ///// <param name="result"></param>
        //void CallbackFun(IAsyncResult result)
        //{
        //    NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
        //    try
        //    {
        //        pipedStream.EndRead(result);
        //    }
        //    catch (System.Exception ex)
        //    {
        //        logEx.Error(ex.ToString());
        //    }
        //}
        /// <summary>
        /// 停止管道
        /// </summary>
        public void Stop()
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            shouldStop = true;
            if (pipedStream == null)
            {
                return;
            }
            ShutdownPipedStream();

            //2015/3/3 销毁定时器,防止内存泄露
            if (namedPipeHasVideoDataTimer != null)
            {
                namedPipeHasVideoDataTimer.Close();
                namedPipeHasVideoDataTimer.Dispose();
                logEx.Debug("Stop namedPipeHasVideoDataTimer Success.");
            }
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:37,代码来源:VideoPipe.cs

示例4: StartControlPtz

        /// <summary>
        /// 开始云台控制,摄像头控制
        /// </summary>
        /// <param name="cameraNo">摄像头编号</param>
        /// <param name="ptzCommand">命令类型</param>
        /// <param name="param">命令参数(速度、倍数)</param>
        /// <returns></returns>
        public SmcError.SmcErr StartControlPtz(string cameraNo, PtzCommandType ptzCommand, int param)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: eLTEVideoMonitor.StartControlPtz.cameraNo:{0},ptzCommand:{1},param:{2}", cameraNo, Enum.GetName(typeof(PtzCommandType), ptzCommand), param);
            SmcErr err = new CgwError();

            //将ptz命令转换成elte的命令
            eLTEPTZControlCode ptzControl = eLTEPTZControlCode.STOP_SEQ;

            switch (ptzCommand)
            {
                case PtzCommandType.PTZ_CMD_DOWN:
                    ptzControl = eLTEPTZControlCode.TILT_DOWN;
                    break;
                case PtzCommandType.PTZ_CMD_FOCUS_IN:
                    ptzControl = eLTEPTZControlCode.FOCUS_NEAR;
                    break;
                case PtzCommandType.PTZ_CMD_FOCUS_OUT:
                    ptzControl = eLTEPTZControlCode.FOCUS_FAR;
                    break;
                case PtzCommandType.PTZ_CMD_IRIS_ENLARGE:
                    ptzControl = eLTEPTZControlCode.IRIS_OPEN;
                    break;
                case PtzCommandType.PTZ_CMD_IRIS_SHRINK:
                    ptzControl = eLTEPTZControlCode.IRIS_CLOSE;
                    break;
                case PtzCommandType.PTZ_CMD_LEFT:
                    ptzControl = eLTEPTZControlCode.PAN_LEFT;
                    break;
                case PtzCommandType.PTZ_CMD_RIGHT:
                    ptzControl = eLTEPTZControlCode.PAN_RIGHT;
                    break;
                case PtzCommandType.PTZ_CMD_UP:
                    ptzControl = eLTEPTZControlCode.TILT_UP;
                    break;
                case PtzCommandType.PTZ_CMD_ZOOM_IN:
                    ptzControl = eLTEPTZControlCode.ZOOM_IN;
                    break;
                case PtzCommandType.PTZ_CMD_ZOOM_OUT:
                    ptzControl = eLTEPTZControlCode.ZOOM_OUT;
                    break;

            }

            ELTE_RESULT result = (ELTE_RESULT)lteSdkClient.PTZControl(Convert.ToInt32(cameraNo), (uint)ptzControl, (uint)(param * iPTZScale));//eLTE云台速度慢,放大20倍

            if (result != ELTE_RESULT.RET_SUCCESS)
            {
                err.SetErrorNo(CgwError.START_CONTROL_PTZ_FAILED);
                logEx.Error("StartControlPtz failed.eLTE sdk error code:{0}", result);
                return err;
            }
            else
            {
                logEx.Debug("StartControlPtz Success");
            }

            return err;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:66,代码来源:eLTEVideoMonitor.cs

示例5: StopControlPtz

        /// <summary>
        /// 停止云台控制,摄像头控制
        /// </summary>
        /// <param name="cameraNo">摄像头编号</param>
        /// <param name="ptzCommand">命令类型</param>
        /// <returns></returns>
        public SmcError.SmcErr StopControlPtz(string cameraNo, PtzCommandType ptzCommandType)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: eLTEVideoMonitor.StopControlPtz({0}).", cameraNo);
            SmcErr err = new CgwError();
            ELTE_RESULT result = (ELTE_RESULT)lteSdkClient.PTZControl(Convert.ToInt32(cameraNo), (uint)eLTEPTZControlCode.STOP_SEQ, 1);

            if (result != ELTE_RESULT.RET_SUCCESS)
            {
                err.SetErrorNo(CgwError.START_CONTROL_PTZ_FAILED);
                logEx.Error("StopControlPtz failed.eLTE sdk error code:{0}", result);
                return err;
            }
            else
            {
                logEx.Debug("StopControlPtz Success");
            }

            return err;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:26,代码来源:eLTEVideoMonitor.cs

示例6: FilterDeviceList

        /// <summary>
        /// 过滤设备列表,获取摄像机和目录列表
        /// </summary>
        /// <param name="deviceList">输入设备列表</param>
        /// <param name="cameraListTemp">返回摄像机列表</param>
        /// <param name="groupListTemp">返回组列表</param>
        private void FilterDeviceList(List<DeviceItem> deviceList, ref List<Camera> cameraListTemp, ref List<CameraGroup> groupListTemp)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: T28181VideoMonitor.FilterDeviceList().");

            try
            {

                foreach (DeviceItem item in deviceList)
                {
                    //根据设备ID获取设备类型
                    string devType = GetResourceType(item.DeviceID);
                    logEx.Debug("FilterDeviceList.devType = {0}", devType);
                    //共享摄像机类型、共享主设备类型,需要通过主设备来查找设备的父节点
                    if (devType == CgwConst.RESOURCE_TYPE_CAMERA || devType == CgwConst.RESOURCE_TYPE_MAIN)
                    {
                        Camera camera = new Camera(item.DeviceID, item.Name);
                        camera.Status = item.Status == "ON" ? CameraStatus.Online : CameraStatus.Offline;
                        camera.ParentID = item.ParentID;
                        camera.DeviceType = devType;
                        cameraListTemp.Add(camera);
                    }
                    //共享目录类型
                    else if (devType == CgwConst.RESOURCE_TYPE_DIR)
                    {
                        CameraGroup group = new CameraGroup(item.DeviceID, item.Name);
                        group.ParentID = item.ParentID;
                        groupListTemp.Add(group);
                    }
                }
            }
            catch (System.Exception ex)
            {
                logEx.Error("FilterDeviceList failed. {0} ", ex.Message);
            }
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:42,代码来源:T28181VideoMonitor.cs

示例7: GetAllCameras

        /// <summary>
        /// 获取摄像头列表及分组信息
        /// </summary>
        /// <param name="isRealTime">是否实时获取,融合网关有个缓存,间隔一段时间获取,默认是从融合网关获取列表,如果该值为true,则实时获取</param>
        /// <param name="cameraList">摄像头列表</param>
        /// <param name="groupList">组信息</param>
        /// <param name="nodeRelationList">分组关系</param>
        /// <returns></returns>
        public SmcErr GetAllCameras(out List<Camera> cameraList, out List<CameraGroup> groupList, out List<NodeRelation> nodeRelationList)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: T28181VideoMonitor.GetAllCameras().");

            SmcErr err = new CgwError();
            cameraList = new List<Camera>();
            groupList = new List<CameraGroup>();
            nodeRelationList = new List<NodeRelation>();

            if (this.cameraOperateLock.TryEnterReadLock(CgwConst.ENTER_LOCK_WAIT_TIME))
            {
                try
                {
                    #region 深度克隆数据
                    foreach (Camera ivsCamera in this.cameraList)
                    {
                        //从缓存获取
                        Camera camera = new Camera(ivsCamera.No, ivsCamera.Name);
                        camera.Status = ivsCamera.Status;
                        cameraList.Add(camera);
                    }
                    foreach (CameraGroup cameraGroup in this.groupList)
                    {
                        CameraGroup cameraGroupTemp = new CameraGroup(cameraGroup.No, cameraGroup.Name);
                        groupList.Add(cameraGroupTemp);
                    }
                    foreach (NodeRelation nodeRelation in this.nodeRelationList)
                    {
                        NodeRelation nodeRelationTemp = new NodeRelation(nodeRelation.No, nodeRelation.Path, nodeRelation.Type);
                        nodeRelationList.Add(nodeRelationTemp);
                    }
                    #endregion
                }
                catch (Exception e)
                {
                    err.SetErrorNo(CgwError.GET_ALL_CAMERAS_FAILED);
                    logEx.Error("Get all cameras failed.Execption message:{0}", e.Message);
                    return err;
                }
                finally
                {
                    this.cameraOperateLock.ExitReadLock();
                }
            }
            logEx.Debug("cameraList.{0}", cameraList.Count);
            logEx.Debug("groupList.{0}", groupList.Count);
            logEx.Debug("nodeRelationList.{0}", nodeRelationList.Count);
            logEx.Debug("Get all cameras success.");
            return err;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:59,代码来源:T28181VideoMonitor.cs

示例8: OnReceivedAllDevice

        /// <summary>
        /// 查询设备列表结束事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void OnReceivedAllDevice(object sender, EventArgs args)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: T28181VideoMonitor.OnReceivedAllDevice().");

            //将实时获取的值放到缓存
            try
            {
                //拷贝devicelist到cameralist
                logEx.Debug("OnReceivedAllDevice.DeviceList.Count = {0}", sipStack.DeviceList.Count);
                GetCameraList(sipStack.DeviceList);
            }
            catch (Exception ex)
            {
                sipStack.isRefreshSucess = false;
                logEx.Error("OnReceivedAllDevice failed.  {0}", ex.Message);
            }
            finally
            {
                //查询结束
                getDeviceEndFlg = true;
            }
            logEx.Trace("Leave: T28181VideoMonitor.OnReceivedAllDevice().");
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:29,代码来源:T28181VideoMonitor.cs

示例9: GetAllCamerasTimer

        /// <summary>
        /// 获取摄像头列表及分组信息定时器
        /// 1、获取系统中所有的域
        /// 2、循环所有的域,查询域下面的分组,递归处理,获取节点关系
        /// 3、查询设备列表
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GetAllCamerasTimer(object sender, System.Timers.ElapsedEventArgs e)
        {
            if (getDeviceEndFlg)
            {
                getDeviceEndFlg = false;
                //查询设备未完成,需要阻塞直到查询结束
                System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();

                NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
                logEx.Trace("Enter: T28181VideoMonitor.GetAllCamerasTimer().");

                try
                {
                    //获取设备列表
                    sipStack.GetDeviceList(serverSignalGateway, deviceID);

                    //开始计时
                    stopwatch.Start();

                    //查询结束或者超时时结束等待
                    while (!getDeviceEndFlg && stopwatch.ElapsedMilliseconds < iQueryDeviceTimeOut)
                    {
                        Thread.Sleep(CgwConst.Thread_Sleep_Time);
                    }
                    if (stopwatch.ElapsedMilliseconds >= iQueryDeviceTimeOut)
                    {
                        logEx.Warn("GetAllCamerasTimer Timeout");
                        sipStack.isRefreshSucess = false;
                    }
                }
                catch (System.Exception ex)
                {
                    logEx.Error("GetAllCamerasTimer failed.Exception message:{0}", ex.Message);
                    sipStack.isRefreshSucess = false;
                }
                finally
                {
                    //停止计时、获取设备完成标志复位
                    stopwatch.Stop();
                    getDeviceEndFlg = true;

                    logEx.Debug("cameraList.{0}", cameraList.Count);
                    logEx.Debug("groupList.{0}", groupList.Count);
                    logEx.Debug("nodeRelationList.{0}", nodeRelationList.Count);
                    logEx.Debug("Leave: T28181VideoMonitor.GetAllCamerasTimer().");
                }
            }
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:56,代码来源:T28181VideoMonitor.cs

示例10: GetSipPort

        /// <summary>
        /// 获取软终端被叫sip端口号
        /// </summary>
        /// <param name="sipPort"></param>
        /// <returns></returns>
        public SmcErr GetSipPort(out uint sipPort)
        {
            NLogEx.LoggerEx logEx = new NLogEx.LoggerEx(log);
            logEx.Trace("Enter: CgwService.GetSipPort");

            SmcErr err = new CgwError();

            sipPort = (uint)ConfigSettings.CgwChanelCallPort;
            logEx.Debug("sipPort = {0}", sipPort);

            if (0 == sipPort)
            {
                err.SetErrorNo(CgwError.ERR_CGW_CONFIGURE_FORMAT);
            }
            return err;
        }
开发者ID:eSDK,项目名称:esdk_Cgw,代码行数:21,代码来源:CgwService.cs


注:本文中的NLogEx.LoggerEx.Debug方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。