Commits

Menglong TAN  committed cfa33eb

del

  • Participants
  • Parent commits 241922a

Comments (0)

Files changed (2)

File include/kerltools_common.hrl

-%%% author tanmenglong <>
-%%% copyright 2009, tanmenglong
-%%% Common definations of functions
-%%% Created :  9 Dec 2009 by tanmenglong <>
-
--define(b2l(P), erlang:binary_to_list(P)).
--define(l2b(P), erlang:list_to_binary(P)).
--define(tm2s(T), lists:flatten(io_lib:format("~p", [T]))).
--define(tm2b(T), list_to_binary(io_lib:format("~p", [T]))).
--define(l2i(L), erlang:list_to_integer(L)).
--define(i2l(I), erlang:integer_to_list(I)).
--define(t2l(T), erlang:tuple_to_list(T)).
-
--define(throw(Reason), erlang:raise(throw, Reason, erlang:get_stacktrace())).
-
-
-
-
-

File include/kerltools_console.hrl

-%%% author TanMenglong <tanmenglong@kingsoft.com>
-%%% copyright 2009, Kingsoft Corp
-%%% Global definations.
-%%% Created : 27 Sep 2009 by TanMenglong <tanmenglong@kingsoft.com>
-
--ifdef(DEBUG).
--define(debug(Format, Data),
-        io:format("***~s(L.~p)::" ++ Format ++ "~n",
-				  [?MODULE, ?LINE] ++ Data)
-       ).
--else.
--define(debug(Format, Data), ok).
--endif.
-
--define(info(Format, Data),
-        io:format("~s::" ++ Format ++ "~n",
-				  [?MODULE] ++ Data)
-       ).
-
--define(log_info(Format, Data),
-        error_logger:info_msg("~s::" ++ Format ++ "~n",
-							  [?MODULE] ++ Data)
-       ).
-
--define(log_warm(Format, Data),
-        error_logger:warning_msg("~s(L.~p)::" ++ Format ++ "~n",
-                                 [?MODULE, ?LINE] ++ Data)
-       ).
-
--define(log_warm_details(Format, Data),
-        error_logger:warning_msg("~s(L.~p)::" ++ Format ++ "~nstack: ~p~n",
-                                 [?MODULE, ?LINE] ++ Data ++
-                                 [erlang:get_stacktrace()])
-       ).
-
--define(log_error(Format, Data),
-        error_logger:error_msg("~s(L.~p)::" ++ Format ++ "~n",
-                               [?MODULE, ?LINE] ++ Data)
-       ).
-
--define(log_error_details(Format, Data),
-        error_logger:error_msg("~s(L.~p)::" ++ Format ++ "~nstack: ~p~n",
-                               [?MODULE, ?LINE] ++ Data ++
-							   [erlang:get_stacktrace()])
-       ).
-
--define(error(Why), erlang:error(Why)).
-
-