<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[yida_young的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/eeeggghit</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; eeeggghit]]></copyright><item><title><![CDATA[Lager输出成html格式的日志]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/111519790</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/111519790</guid><author>eeeggghit</author><pubDate>Tue, 22 Dec 2020 11:33:00 +0800</pubDate><description><![CDATA[简介
lager是erlang和exlir的一个日志库，输出格式支持自定义，可以通过额外插件扩展将日志输出成html格式，这样异常日志从颜色上就可以明显的看出来，方便调试
使用
库已经上传了hex库，可以通过以下3种方式中任一使用

mix 中加入{:lager_html, "~&gt; 0.0.1"}
rebar.config 的deps 中加入 {lager_html, "0.0.1"}
erlang.mk 中加入 dep_lager_html = hex 0.0.1

如果hex下载失败，按照reba]]></description><category></category></item><item><title><![CDATA[rebar3使用本地依赖]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/109001792</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/109001792</guid><author>eeeggghit</author><pubDate>Sat, 10 Oct 2020 18:14:33 +0800</pubDate><description><![CDATA[简介
erlang提供了rebar3来管理依赖和编译项目，结合git和hex，项目的依赖管理会非常简单。项目本体也会非常精简。但是也带来了问题就是项目本身必须依赖外网才可以构建，因为deps库一般都是从git或者hex上进行的下载。如果是内网环境下，就无法进行构建，只能提前将依赖在外网环境下下载完整再本地进行构建。
同样如果网络环境比较差，国内连接hex的本站速度也比较慢，意味着每次构建都需要很久，因此如果能将依赖从本地进行拉取就会快很多。
实现
rebar3提供了插件功能，在有了插件功能后，就可以在不修改]]></description><category></category></item><item><title><![CDATA[Mac安装解决erlang最新版本（23）安装失败的问题]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/108997708</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/108997708</guid><author>eeeggghit</author><pubDate>Sat, 10 Oct 2020 15:38:58 +0800</pubDate><description><![CDATA[编译安装
mac最新的版本因为openssl的安全问题，不再默认链接openssl库，所以必须手动配置库，整体还是很折腾
brew reinstall coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc
brew link coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc

export KERL_C]]></description><category></category></item><item><title><![CDATA[解决rebar3在中文环境下部分命令失败]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/108751888</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/108751888</guid><author>eeeggghit</author><pubDate>Wed, 23 Sep 2020 14:24:52 +0800</pubDate><description><![CDATA[问题
rebar3因为毕竟是基于英文环境开发的，很多命令匹配都是基于英文返回内容，因此可能部分命令会执行失败
===&gt; Verifying dependencies...
===&gt; Compiling game_fight
===&gt; Assembling release game_fight-0.1.0...
===&gt; Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.]]></description><category></category></item><item><title><![CDATA[IDEA支持erlang的protobuffer定义的结构体直接跳转到proto文件]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/108447087</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/108447087</guid><author>eeeggghit</author><pubDate>Mon, 07 Sep 2020 14:48:46 +0800</pubDate><description><![CDATA[简介
erlang的protobuffer使用无论是使用erlang_protobuffs还是gpb，一般都是将proto转成erlang的record，然后编码的时候使用record来进行编写。当然gpb也支持将proto转换成maps格式，但是maps格式在IDE上的提示无法做的很完善。因此本文还是基于gpb转换的record形式的proto来做介绍
依赖

测试环境基于IDEA 2020.1，需要提前安装好erlang插件
之后便是关键的proto插件，proto插件在Google开源后有人进行了维护]]></description><category></category></item><item><title><![CDATA[使用IDEA进行erlang的断点调试]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/106021723</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/106021723</guid><author>eeeggghit</author><pubDate>Tue, 12 May 2020 18:37:25 +0800</pubDate><description><![CDATA[简介
IDEA可是说是目前对erlang语言支持最好的IDE了，包括文件跳转，代码提示等已经相当成熟。但是因为缺少官方维护，erlang的debug功能还是相对简陋的，包括当前最新版本的erlang插件，对debug功能的支持也不能算完整。
erlang官方也提供了debug功能，虽然易用性上还是偏弱，但是功能还是相对比较完整。每次重启的时候必须重新载入环境，断点之类的配置都是在环境中。如果调试需要重启节点，就会很麻烦。
IDEA提供的基础debug
IDEA的erlang插件提供的debug大体上可以分为]]></description><category></category></item><item><title><![CDATA[Lager库使用介绍]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/103349224</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/103349224</guid><author>eeeggghit</author><pubDate>Mon, 16 Dec 2019 15:19:46 +0800</pubDate><description><![CDATA[使用Lager库来管理erlang应用的日志模块
erlang本身已经提供了基础的日志模块error_logger还有OTP 21.0之后的Logger模块，这些模块在项目比较轻量，日志可控，功能简单的情况下完全可以满足需要，但是Lager提供了一个更加成熟的完整的解决方案，从日志文件的配置，等级设定，到跟踪，日志文件轮转提供了完整的生态接口，通过Lager几乎可以满足所有的日志需求，而且不需要考...]]></description><category></category></item><item><title><![CDATA[Lager库的Trace功能使用]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/103495980</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/103495980</guid><author>eeeggghit</author><pubDate>Mon, 16 Dec 2019 15:19:15 +0800</pubDate><description><![CDATA[简介
Lager的trace功能十分强大，在生产环境中，我们需要使用日志来配合定位问题，而如果只是单纯的使用日志等级来控制，在日志量非常大的时候可能会有性能负担，同时日志文件也难以查找，使用trace可以清晰的筛选我们想要的日志，且不影响其他日志逻辑


...]]></description><category></category></item><item><title><![CDATA[mongo日志按天切割]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/100209270</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/100209270</guid><author>eeeggghit</author><pubDate>Mon, 02 Sep 2019 11:10:10 +0800</pubDate><description><![CDATA[mongo日志按天切割
mongodb日志默认是单个文件的append模式，也就意味着日志文件会愈来愈大
可以通过mongodb提供的logRotate逻辑实现一个日志切割和过期日志删除的脚本
脚本内容如下
#!/bin/sh
source /root/.bashrc

DAYS=7 #DAYS=7代表删除7天前的备份，即只保留最近7天的备份

echo -e "use admin \n db.r...]]></description><category></category></item><item><title><![CDATA[Docker学习总结]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/87368653</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/87368653</guid><author>eeeggghit</author><pubDate>Fri, 15 Feb 2019 16:21:02 +0800</pubDate><description><![CDATA[简介
Docker是一种类似虚拟机的技术，通过docker，可以在一台云主机，物理机上运行完全隔离的独立环境，环境都是通过DockerFIle描述，发布成镜像后，通过镜像就可以在任意环境下
实现相同环境的运行，例如开发环境是mac下，有些编译内容和纯linux下不一定相同，到发布时可能需要重新编译。通过docker可以将应用和环境进行粘合，无论在什么主机条件下，应用运行的环境永远都是一样的。
除此...]]></description><category></category></item><item><title><![CDATA[基于win10自带虚拟机安装UbuntuServer]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/87367210</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/87367210</guid><author>eeeggghit</author><pubDate>Fri, 15 Feb 2019 16:01:29 +0800</pubDate><description><![CDATA[本文只是记录安装过程中可能遇到的疑难问题，基础步骤参照给出的链接中的文章即可，这里只是一个新安装环境会遇到的问题整理
开启Hyper-v和安装虚拟机的方法不细述了，网上有很多
开启Hyper-v
安装Ubuntu
这里只额外介绍下网上讲的比较少的部分
安装部分
Ubuntu镜像可以在163提供的地址进行下载，也可以在官方进行下载，不过163快的多
安装的时候可能会遇到说镜像没通过安全检查之类的，如...]]></description><category></category></item><item><title><![CDATA[搭建http文件分享服务器]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/87098658</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/87098658</guid><author>eeeggghit</author><pubDate>Tue, 12 Feb 2019 16:54:34 +0800</pubDate><description><![CDATA[简介
在内网中，通过简单的文件夹共享就可以达到不同pc之间互相访问文件，但是可能会受到权限或者防火墙的问题，导致共享失败。
或者如果有自动化需求，文件共享的文件不能像使用wget命令这样直接简单的进行下载，因此可以在内网中搭建一个基于http的文件分享服务器，既能确保分享成功，又可以在需要自动化的时候进行支持
本文将介绍两种在Mac环境下搭建文件服务器的方法：
基于Apache
Mac自带了Apa...]]></description><category></category></item><item><title><![CDATA[rebar3使用介绍（七）测试]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/83994697</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/83994697</guid><author>eeeggghit</author><pubDate>Mon, 12 Nov 2018 16:59:37 +0800</pubDate><description><![CDATA[rebar3使用介绍（七）测试eunitcommon test (ct)代码覆盖率
Rebar3内置了eunit和ct（common_test）测试运行器。通过遵循一些约定，您可以使用单个Rebar3命令运行测试套件。
eunit
运行eunit测试非常简单：
$ rebar3 eunit

Rebar3将带上宏{d, TEST, true}和{d, EUNIT, true}编译所有项目模块，以便...]]></description><category></category></item><item><title><![CDATA[rebar3使用介绍（六）用户自定义文件配置]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/83994678</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/83994678</guid><author>eeeggghit</author><pubDate>Mon, 12 Nov 2018 16:58:51 +0800</pubDate><description><![CDATA[rebar3使用介绍（五）用户自定义文件配置例子选项合并算法

依赖和配置文件
依赖永远按照prod模式对应的profile进行编译，不会有其他（当然不包括default）任何东西会被额外的套用上来，即使它们是为prod依赖项配置的，仍然会将其提取到其声明的配置文件的配置文件目录中。例如，顶层的依赖关系deps将放在_build/default/lib下，test将放在_build/test/li...]]></description><category></category></item><item><title><![CDATA[rebar3使用介绍（五）自定义依赖获取方式]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/83994662</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/83994662</guid><author>eeeggghit</author><pubDate>Mon, 12 Nov 2018 16:58:16 +0800</pubDate><description><![CDATA[rebar3使用介绍（四）自定义依赖获取方式
每个依赖获取方式都是 rebar_resorece behavior描述
-module(rebar_resource).

-export_type([resource/0
             ,type/0
             ,location/0
             ,ref/0]).

-type resource() ::...]]></description><category></category></item><item><title><![CDATA[rebar3使用介绍（四）依赖]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/83994645</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/83994645</guid><author>eeeggghit</author><pubDate>Mon, 12 Nov 2018 16:57:44 +0800</pubDate><description><![CDATA[rebar3使用介绍（四）依赖声明依赖关系源依赖包依赖Checkout 依赖更新依赖锁文件 Lock File依赖锁管理

依赖关系和配置文件
将始终使用prod应用于其配置的配置文件编译依赖项。没有其他（default当然，除此之外）用于任何依赖。即使它们是为prod依赖项配置的，仍然会将其提取到其声明的配置文件的配置文件目录中。例如，顶层的依赖deps将存放在_build/default/li...]]></description><category></category></item><item><title><![CDATA[rebar3使用介绍（三）命令]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/83826105</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/83826105</guid><author>eeeggghit</author><pubDate>Mon, 12 Nov 2018 16:57:02 +0800</pubDate><description><![CDATA[rebar3使用介绍（三）ascompilecleanctcoverdepsdodialyzeredocescriptizeeunitget-depshelpnewpathpkgsreleaserelupreportshelltartreelockunlockupdateupgradeversionxref
本篇主要介绍rebar3的命令
as
它使配置文件名称和任务列表在该配置文件下运行.
举个...]]></description><category></category></item><item><title><![CDATA[rebar3使用介绍（二）配置项]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/83781530</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/83781530</guid><author>eeeggghit</author><pubDate>Mon, 12 Nov 2018 16:56:33 +0800</pubDate><description><![CDATA[rebar3使用介绍（二）全局配置Alias 别名ArtifactsCompilation测试选项CoverDialyzerDistributionDirectories 目录EDocEscriptEUnit最小OTP版本检查OverridesHook 钩子shell钩子功能钩子自写功能中可以hook的点RELXSHELLXRef
本篇主要介绍rebar3的配置部分
全局配置
rebar3支持全局...]]></description><category></category></item><item><title><![CDATA[Rebar3使用介绍（一）基础用法]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/83754063</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/83754063</guid><author>eeeggghit</author><pubDate>Mon, 12 Nov 2018 16:55:56 +0800</pubDate><description><![CDATA[Rebar3使用介绍（一）安装基础用法创建一个新的app或者release加入deps依赖编译输出配置测试发布
本文基本都是按照rebar3官方文档翻译加上自己的理解整理而成，可能有纰漏，疑惑部分请查看原文订正。
安装


使用源码安装

$ git clone https://github.com/erlang/rebar3.git
$ cd rebar3
$ ./bootstrap


直接下...]]></description><category></category></item><item><title><![CDATA[使用Ranch搭建自己的TCP连接池]]></title><link>https://blog.youkuaiyun.com/eeeggghit/article/details/83546235</link><guid>https://blog.youkuaiyun.com/eeeggghit/article/details/83546235</guid><author>eeeggghit</author><pubDate>Wed, 31 Oct 2018 17:28:47 +0800</pubDate><description><![CDATA[将Ranch集成到自己的项目中

]]></description><category></category></item></channel></rss>