ksauzz weblog

technical note....

Erlangと周辺技術のメモ

gistのメモを移行

gen_server

trace debug

1
gen_server:start_link({local, ?SERVER}, ?MODULE, [], [{debug,[trace]}])

rebar

dependencies in rebar.config

rebar.config
1
2
3
{deps, [
  {webmachine, "1.9.0", {git, "https://github.com/basho/webmachine.git", {tag,"1.9.0"}}}
]}.

generate skelton codes

  • ./rebar create-app appid=xxx
  • ./rebar create template=simplemod modid=xxx
  • ./rebar create template=simplesrv srvid=xxx_serve

packaging

1
2
3
4
mkdir rel
cd rel
../rebar create-node nodeid=ememcached
../rebar generate

see: https://github.com/basho/rebar/tree/master/priv/templates

dialyzer

Static analysis tool. http://www.erlang.org/doc/man/dialyzer.html

build plt file

dialyzer --build_plt --apps erts kernel stdlib

extend plt file

dialyzer --add_to_plt --apps mnesia

analyse sources

dialyzer --src src/*.erl

typer

Type anotator.

show type

typer -I include src/*.erl

insert type into the erlang codes.

typer --annotate -I include src/*.erl

Comments