Sha256: a7215dff9b9dc50311bfca7a4be3e5a0fd26bd57dee6b681ee64a2e3f3af7eda
Contents?: true
Size: 626 Bytes
Versions: 5
Compression:
Stored size: 626 Bytes
Contents
-module (tailor). -compile(export_all). -import (mochijson2). -include ("cloudpanel.hrl"). go(Qs) -> Body = case Qs of "log" -> latest_log(Qs); _ -> index(Qs) end, io:format("Body from go: ~p~n", [Body]), Body. index(Qs) -> File = proplists:get_value("log", Qs), % Tell the system that we are watching the logs self() ! {self(), subscribe}, % Wait for messages Dir = "/var/log", % Callback = fun(X) -> displayLogLine(X, Log) end, Cmd = "/usr/bin/tail -n 10 "++ Dir ++ "/" ++ File, Body = os:cmd(Cmd), string:join(string:tokens(Body, "\n"), "\n"). latest_log(Qs) -> ok. start_logger(File) -> ok.
Version data entries
5 entries across 5 versions & 1 rubygems