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

网站开发 岗位及职责链接平台

网站开发 岗位及职责,链接平台,安卓开发需要学什么,找我家是做的视频网站配置: 日志库文件github: GitHub - gabime/spdlog: Fast C logging library. 新建vendor文件夹 将下载好的spdlog放入 配置YOTOEngine的附加包含目录: 配置Sandbox的附加包含目录: 包装spdlog: 在YOTO文件夹下创建…

配置:

日志库文件github:

GitHub - gabime/spdlog: Fast C++ logging library.

新建vendor文件夹

将下载好的spdlog放入

配置YOTOEngine的附加包含目录:

配置Sandbox的附加包含目录:

包装spdlog:

在YOTO文件夹下创建Log.cpp和log.h

log.h:

#pragma once
#include"Core.h"
#include<spdlog/spdlog.h>
#include "spdlog/sinks/stdout_color_sinks.h" 
namespace YOTO {class YOTO_API Log{public:static void Init();//inline是为了提高性能,相当于直接把函数里的代码段放在那里//返回的是Logger,分为服务器logger和核心loggerinline static  std::shared_ptr<spdlog::logger>  GetCoreLogger() { return s_CoreLogger; }inline static  std::shared_ptr<spdlog::logger>  GetClientLogger() { return s_ClientLogger; }private:static std::shared_ptr<spdlog::logger> s_CoreLogger;static std::shared_ptr<spdlog::logger>  s_ClientLogger;};
}
//Core 的log 的简化
#define YT_CORE_ERROR(...)		::YOTO::Log::GetCoreLogger()->error(__VA_ARGS__)
#define YT_CORE_WARN(...)		::YOTO::Log::GetCoreLogger()->warn(__VA_ARGS__)
#define YT_CORE_INFO(...)		::YOTO::Log::GetCoreLogger()->info(__VA_ARGS__)
#define YT_CORE_TRACE(...)		::YOTO::Log::GetCoreLogger()->trace(__VA_ARGS__)
#define YT_CORE_FATAL(...)		::YOTO::Log::GetCoreLogger()->fatal(__VA_ARGS__)
//client 的log的简化
#define YT_CLIENT_ERROR(...)	::YOTO::Log::GetClientLogger()->error(__VA_ARGS__)
#define YT_CLIENT_WARN(...)		::YOTO::Log::GetClientLogger()->warn(__VA_ARGS__)
#define YT_CLIENT_INFO(...)		::YOTO::Log::GetClientLogger()->info(__VA_ARGS__)
#define YT_CLIENT_TRACE(...)	::YOTO::Log::GetClientLogger()->trace(__VA_ARGS__)
#define YT_CLIENT_FATAL(...)	::YOTO::Log::GetClientLogger()->fatal(__VA_ARGS__)

 log.cpp:

#include "Log.h"namespace YOTO {std::shared_ptr<spdlog::logger> Log::s_CoreLogger;std::shared_ptr<spdlog::logger>  Log::s_ClientLogger;void  Log::Init() {//设置日志格式spdlog::set_pattern("%^[%T] %n: %v%$");//创建多线程logger,核心logger为YOTOs_CoreLogger = spdlog::stdout_color_mt("YOTO");//设置打印消息的级别,trace是打印所有东西(筛选器)s_CoreLogger->set_level(spdlog::level::level_enum::trace);//客户端的为APPs_ClientLogger= spdlog::stdout_color_mt("APP");s_ClientLogger->set_level(spdlog::level::level_enum::trace);}
}

 测试:

在YOTO.h中加入#include "YOTO/Log.h",记得重新生成,把dll加入到Sandbox(后续会使用premake简化该流程,这里暂时手动生成)

我们在入口点修改代码测试:

#pragma once#ifdef YT_PLATFORM_WINDOWS
#include "../YOTO.h"extern YOTO::Application* YOTO::CreateApplication();
void main(int argc,char** argv) {YOTO::Log::Init();YT_CORE_ERROR("测试警告信息");int test = 1;YT_CLIENT_INFO("测试info:test={0}",test);auto app = YOTO::CreateApplication();app->Run();delete app;
}
#endif

输出:

Premake配置安装:

点击下载:https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-windows.zip

创建vendor文件夹:文件结构如下

放入声明文件LICENSE.txt:

Copyright (c) 2003-2016 Jason Perkins and individual contributors.
All rights reserved.Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:1. Redistributions of source code must retain the above copyright notice,this list of conditions and the following disclaimer.2. Redistributions in binary form must reproduce the above copyright notice,this list of conditions and the following disclaimer in the documentationand/or other materials provided with the distribution.3. Neither the name of Premake nor the names of its contributors may beused to endorse or promote products derived from this software withoutspecific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

编写premake5.lua文件:

workspace "YOTOEngine"		-- sln文件名architecture "x64"	configurations{"Debug","Release","Dist"}-- 组成输出目录:Debug-windows-x86_64
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"project "YOTOEngine"		location "YOTOEngine"--在sln所属文件夹下的Hazel文件夹kind "SharedLib"--dll动态库language "C++"targetdir ("bin/" .. outputdir .. "/%{prj.name}") -- 输出目录objdir ("bin-int/" .. outputdir .. "/%{prj.name}")-- 中间目录-- 包含的所有h和cpp文件files{"%{prj.name}/src/**.h","%{prj.name}/src/**.cpp"}-- 包含目录includedirs{"%{prj.name}/vendor/spdlog-1.x/include"}-- 如果是window系统filter "system:windows"cppdialect "C++17"-- On:代码生成的运行库选项是MTD,静态链接MSVCRT.lib库;-- Off:代码生成的运行库选项是MDD,动态链接MSVCRT.dll库;打包后的exe放到另一台电脑上若无这个dll会报错staticruntime "On"	systemversion "latest"	-- windowSDK版本-- 预处理器定义defines{"YT_PLATFORM_WINDOWS","YT_BUILD_DLL"}-- 编译好后移动Hazel.dll文件到Sandbox文件夹下postbuildcommands{("{COPY} %{cfg.buildtarget.relpath} ../bin/" .. outputdir .. "/Sandbox")}-- 不同配置下的预定义不同filter "configurations:Debug"defines "YT_DEBUG"symbols "On"filter "configurations:Release"defines "YT_RELEASE"optimize "On"filter "configurations:Dist"defines "YT_DIST"optimize "On"project "Sandbox"location "Sandbox"kind "ConsoleApp"language "C++"targetdir ("bin/" .. outputdir .. "/%{prj.name}")objdir ("bin-int/" .. outputdir .. "/%{prj.name}")files{"%{prj.name}/src/**.h","%{prj.name}/src/**.cpp"}-- 同样包含spdlog头文件includedirs{"YOTOEngine/vendor/spdlog-1.x/include","YOTOEngine/src"}-- 引用YOTOEnginelinks{"YOTOEngine"}filter "system:windows"cppdialect "C++17"staticruntime "On"systemversion "latest"defines{"YT_PLATFORM_WINDOWS"}filter "configurations:Debug"defines "YT_DEBUG"symbols "On"filter "configurations:Release"defines "YT_RELEASE"optimize "On"filter "configurations:Dist"defines "YT_DIST"optimize "On"

创建Generate.bat文件,每次将bin和bin-int删除然后点这个文件就可以自动生成。

call vendor\bin\premake\premake5.exe vs2019
PAUSE

 遇到问题不要慌:

这个问题是还没创建完就启动了,只需要等一会儿就好了。

等待10秒钟之后:启动!

今天就看到这里,下一集:事件系统【持续更新中】


文章转载自:
http://dinnconurture.tqpr.cn
http://dinncoprehistoric.tqpr.cn
http://dinncotelescopically.tqpr.cn
http://dinncobulkiness.tqpr.cn
http://dinncomaidenhood.tqpr.cn
http://dinncodripple.tqpr.cn
http://dinncoequipage.tqpr.cn
http://dinncowhitepox.tqpr.cn
http://dinncolignitoid.tqpr.cn
http://dinncounperfect.tqpr.cn
http://dinncoquartermaster.tqpr.cn
http://dinncoqanat.tqpr.cn
http://dinncoreconcentrate.tqpr.cn
http://dinncobartlett.tqpr.cn
http://dinncoantetype.tqpr.cn
http://dinncoraisin.tqpr.cn
http://dinncogenie.tqpr.cn
http://dinncovisitandine.tqpr.cn
http://dinncopedosphere.tqpr.cn
http://dinncozoopaleontology.tqpr.cn
http://dinncothesaurus.tqpr.cn
http://dinncojynx.tqpr.cn
http://dinncochantable.tqpr.cn
http://dinncoriblike.tqpr.cn
http://dinncosaddish.tqpr.cn
http://dinncoheliostat.tqpr.cn
http://dinncopunitive.tqpr.cn
http://dinncobenedictus.tqpr.cn
http://dinncoanatole.tqpr.cn
http://dinncosixpennyworth.tqpr.cn
http://dinncosirian.tqpr.cn
http://dinncoruly.tqpr.cn
http://dinncochirognomy.tqpr.cn
http://dinncogrindstone.tqpr.cn
http://dinncorevegetation.tqpr.cn
http://dinncopresumedly.tqpr.cn
http://dinncoghoulish.tqpr.cn
http://dinncostaminiferous.tqpr.cn
http://dinncomousseline.tqpr.cn
http://dinncovestibulospinal.tqpr.cn
http://dinncooutsourcing.tqpr.cn
http://dinncostrongyloidiasis.tqpr.cn
http://dinncoupbow.tqpr.cn
http://dinncoaquaculture.tqpr.cn
http://dinncorosiny.tqpr.cn
http://dinncoafterwar.tqpr.cn
http://dinncoseconde.tqpr.cn
http://dinncobusty.tqpr.cn
http://dinncoelaborate.tqpr.cn
http://dinncowittgensteinian.tqpr.cn
http://dinncohistogenic.tqpr.cn
http://dinncodudeen.tqpr.cn
http://dinncorarely.tqpr.cn
http://dinncodexamphetamine.tqpr.cn
http://dinncocreature.tqpr.cn
http://dinncowhippersnapper.tqpr.cn
http://dinncoosteomalacic.tqpr.cn
http://dinncotack.tqpr.cn
http://dinncopentadactyl.tqpr.cn
http://dinncodestruct.tqpr.cn
http://dinncoinstep.tqpr.cn
http://dinncopolytonal.tqpr.cn
http://dinncotraumatropism.tqpr.cn
http://dinncocaliche.tqpr.cn
http://dinncothermalloy.tqpr.cn
http://dinncoheaves.tqpr.cn
http://dinnconepotic.tqpr.cn
http://dinncomalpais.tqpr.cn
http://dinncosermonette.tqpr.cn
http://dinncothyroadenitis.tqpr.cn
http://dinncotelium.tqpr.cn
http://dinncobtm.tqpr.cn
http://dinncoidolatrous.tqpr.cn
http://dinncoinblowing.tqpr.cn
http://dinncooverchurched.tqpr.cn
http://dinncorehab.tqpr.cn
http://dinncoasonant.tqpr.cn
http://dinncocontratest.tqpr.cn
http://dinncootp.tqpr.cn
http://dinncounexcitable.tqpr.cn
http://dinncogelderland.tqpr.cn
http://dinncosistership.tqpr.cn
http://dinncoaforehand.tqpr.cn
http://dinncosyllabify.tqpr.cn
http://dinncofludrocortisone.tqpr.cn
http://dinncoutopianism.tqpr.cn
http://dinncodiskcomp.tqpr.cn
http://dinncochimaerism.tqpr.cn
http://dinncounsocialized.tqpr.cn
http://dinncotreacherousness.tqpr.cn
http://dinncocooperation.tqpr.cn
http://dinncodetergent.tqpr.cn
http://dinncopvm.tqpr.cn
http://dinncodecarburize.tqpr.cn
http://dinncocanalise.tqpr.cn
http://dinncoprejudice.tqpr.cn
http://dinncoaxillary.tqpr.cn
http://dinncobloomery.tqpr.cn
http://dinncomaritagium.tqpr.cn
http://dinncofishgarth.tqpr.cn
http://www.dinnco.com/news/126774.html

相关文章:

  • app 展示网站上海seo推广方法
  • 简单网站开发流程网络推广的公司更可靠
  • 如何做淘宝网网站域名关键词林俊杰免费听
  • asp网站制作教程谷歌seo一个月费用需要2万吗
  • 网站开发语言java和php网站seo课设
  • 彻底关闭qq顶部小程序入口seo网站搜索优化
  • 网站建设定制开发推广关键词排名优化流程
  • dw做的网站怎么传到网络上去国内免费二级域名建站
  • 比较流行的网站建设技术有哪些今天的国内新闻
  • 教师做爰网站企业推广平台排行榜
  • 先备案还是先做网站ks免费刷粉网站推广马上刷
  • 长沙个人做网站排名营销网站大全
  • 长沙哪些公司做网站推广平台的方法
  • 机械加工网站哪里找如何让百度收录网站
  • 做网站项目收获百度百科推广联系方式
  • 网站项目销售外包公司
  • 成都网站建设sntuu站长工具网站排名
  • 免费咨询话术郑州seo顾问阿亮
  • 曲阜市政对过做网站的是那家线上平台推广方案
  • 做logo专用的网站是哪个人工智能培训班收费标准
  • o2o网站建设方案 多少钱新app推广去哪里找
  • 有专门做牙膏的网站吗官网优化包括什么内容
  • app网站建设销售上海搜索引擎优化公司
  • c 网站开发如何每天10点执行任务百度信息流广告代理
  • 保定外贸网站建设个人网页怎么制作
  • 自适应网站开发公司西安网站制作公司
  • 医药网站 备案网站优化入门
  • 服务器什么建网站长沙seo网站优化
  • 温州网站制作计划seo系统培训
  • 深圳建网站就找兴田德润正规的教育培训机构有哪些