当前位置: 首页 > news >正文

UE4/UE5 日志插件(基于spdlog)

1 解决问题

对于高频日志序列化到本地的需求,spdlog肯定完美满足。

源码地址:https://github.com/gabime/spdlog

博主下载的版本为 spdlog-1.12.0,各位大佬可以根绝自己爱好选择。

2 过程介绍

大概目录:

SpdlogLibC目录下是对spdlog的封装:

bin里是.dll,lib放是.lib,include是.h文件。

SpdLoggerLib.Build.cs文件内容:

// Copyright Epic Games, Inc. All Rights Reserved.using UnrealBuildTool;
using System.IO;public class SpdLoggerLib : ModuleRules
{private string OuterLibPath{get { return Path.GetFullPath(Path.Combine(ModuleDirectory, "SpdlogLibC/")); }}public SpdLoggerLib(ReadOnlyTargetRules Target) : base(Target){PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;PublicIncludePaths.AddRange(new string[] { });PrivateIncludePaths.AddRange(new string[] {// ... add other private include paths required here ...});PublicDependencyModuleNames.AddRange(new string[]{"Core","Projects"// ... add other public dependencies that you statically link with here ...});PrivateDependencyModuleNames.AddRange(new string[]{"CoreUObject","Engine","InputCore"// ... add private dependencies that you statically link with here ...	});DynamicallyLoadedModuleNames.AddRange(new string[]{// ... add any modules that your module loads dynamically here ...});if (Target.Platform == UnrealTargetPlatform.Win64){string LibPath = OuterLibPath + "lib/x64/";string DllPath = OuterLibPath + "bin/x64/";string IncludePath = OuterLibPath + "include/";PublicSystemIncludePaths.AddRange(new string[] {IncludePath});foreach (string file in Directory.GetFiles(LibPath)){PublicAdditionalLibraries.Add(file);}foreach (string file in Directory.GetFiles(DllPath)){string filename = Path.GetFileName(file);string outdll = "$(TargetOutputDir)/";outdll += filename;RuntimeDependencies.Add(outdll, file);}}else if (Target.Platform == UnrealTargetPlatform.Mac) { }else if (Target.Platform == UnrealTargetPlatform.Linux) { }}
}

3 使用简介

将插件拷贝到您的项目插件目录下:

蓝图里直接使用:

产生的日志在您的项目content根目录下:

4 插件特点

  • 屏蔽大量实现细节,只暴露一个接口到蓝图;
  • 足够高效,继承了spdlog的多线程、高并发;
  • 封装的原生dll库不区分debug和release,实用性更广。

5 下载地址

UE4/5高并发日志插件资源-CSDN文库

http://www.lryc.cn/news/262761.html

相关文章:

  • 微信小程序ios中非cover组件点击重复触发地图tap事件
  • 7.26 SpringBoot项目实战【还书】
  • Golang中使用errors返回调用堆栈信息
  • Web前端-HTML(常用标签)
  • 一 OpenCV中的数据类型
  • 59. 螺旋矩阵 II(java实现,史上最详细教程,想学会的进!!!)
  • vue 将后端返回的二进制流进行处理并实现下载
  • PyCharm连接远程服务器
  • 使用Qt制作网易云播放器的歌曲排行界面
  • 【.NET Core】特性(Attribute)详解
  • 【C++】POCO学习总结(十九):哈希、URL、UUID、配置文件、日志配置、动态库加载
  • 1846_安全SPI
  • SQL Server ,使用递归查询具有层级关系的数据。
  • 【参数汇总】mysql服务端/客户端常见优化参数
  • LeetCode 142. 环形链表 II
  • Leetcode刷题笔记题解(C++):224. 基本计算器
  • 还在为学MyBatis发愁?史上最全,一篇文章带你学习MyBatis
  • C# WPF上位机开发(树形控件在地图软件中的应用)
  • 【华为】文档中命令行约定格式规范(命令行格式规范、命令行行为规范、命令行参数格式、命令行规范)
  • Trie 字典树(c++)(前缀)
  • 全球移动通信(2G/3G/4G/5G)频谱分布情况
  • 【04】GeoScene导出海图或者电子航道图000数据成果
  • 安卓端出现https请求失败(转)
  • appium2.0.1安装完整教程+uiautomator2安装教程
  • Hbase的Rowkey设计
  • 软考机考考试第一批经验分享
  • 架构简洁之道有感,谈谈软件组件聚合的张力
  • 计算机网络 网络层上 | IP数据报,IP地址,ICMP,ARP等
  • 金智融门户(统一身份认证)同步数据至钉钉通讯录
  • 服务器RAID配置及功能介绍