Log refinement - logging process IDs
This commit is contained in:
parent
c306d49a85
commit
2b8a37439d
2 changed files with 13 additions and 9 deletions
|
@ -47,7 +47,7 @@
|
||||||
{"P0006",
|
{"P0006",
|
||||||
{info, "Orphaned reply after timeout on L0 file write ~s"}},
|
{info, "Orphaned reply after timeout on L0 file write ~s"}},
|
||||||
{"P0007",
|
{"P0007",
|
||||||
{info, "Sent release message for cloned Penciller following close for "
|
{debug, "Sent release message for cloned Penciller following close for "
|
||||||
++ "reason ~w"}},
|
++ "reason ~w"}},
|
||||||
{"P0008",
|
{"P0008",
|
||||||
{info, "Penciller closing for reason ~w"}},
|
{info, "Penciller closing for reason ~w"}},
|
||||||
|
@ -105,7 +105,7 @@
|
||||||
{"PC005",
|
{"PC005",
|
||||||
{info, "Penciller's Clerk ~w shutdown now complete for reason ~w"}},
|
{info, "Penciller's Clerk ~w shutdown now complete for reason ~w"}},
|
||||||
{"PC006",
|
{"PC006",
|
||||||
{info, "Work prompted but none needed ~w"}},
|
{info, "Work prompted but none needed"}},
|
||||||
{"PC007",
|
{"PC007",
|
||||||
{info, "Clerk prompting Penciller regarding manifest change"}},
|
{info, "Clerk prompting Penciller regarding manifest change"}},
|
||||||
{"PC008",
|
{"PC008",
|
||||||
|
@ -249,11 +249,13 @@ log(LogReference, Subs) ->
|
||||||
{ok, {LogLevel, LogText}} = dict:find(LogReference, ?LOGBASE),
|
{ok, {LogLevel, LogText}} = dict:find(LogReference, ?LOGBASE),
|
||||||
case lists:member(LogLevel, ?LOG_LEVEL) of
|
case lists:member(LogLevel, ?LOG_LEVEL) of
|
||||||
true ->
|
true ->
|
||||||
io:format(LogReference ++ " " ++ LogText ++ "~n", Subs);
|
io:format(LogReference ++ " ~w " ++ LogText ++ "~n",
|
||||||
|
[self()|Subs]);
|
||||||
false ->
|
false ->
|
||||||
ok
|
ok
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
log_timer(LogReference, Subs, StartTime) ->
|
log_timer(LogReference, Subs, StartTime) ->
|
||||||
{ok, {LogLevel, LogText}} = dict:find(LogReference, ?LOGBASE),
|
{ok, {LogLevel, LogText}} = dict:find(LogReference, ?LOGBASE),
|
||||||
case lists:member(LogLevel, ?LOG_LEVEL) of
|
case lists:member(LogLevel, ?LOG_LEVEL) of
|
||||||
|
@ -265,15 +267,17 @@ log_timer(LogReference, Subs, StartTime) ->
|
||||||
MicroS ->
|
MicroS ->
|
||||||
{"ms", MicroS div 1000}
|
{"ms", MicroS div 1000}
|
||||||
end,
|
end,
|
||||||
io:format(LogReference ++ " " ++ LogText ++ " with time taken ~w "
|
io:format(LogReference ++ " ~w " ++ LogText
|
||||||
++ Unit ++ "~n",
|
++ " with time taken ~w " ++ Unit ++ "~n",
|
||||||
Subs ++ [Time]);
|
[self()|Subs] ++ [Time]);
|
||||||
false ->
|
false ->
|
||||||
ok
|
ok
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%%%============================================================================
|
%%%============================================================================
|
||||||
%%% Test
|
%%% Test
|
||||||
%%%============================================================================
|
%%%============================================================================
|
||||||
|
@ -283,7 +287,7 @@ log_timer(LogReference, Subs, StartTime) ->
|
||||||
-ifdef(TEST).
|
-ifdef(TEST).
|
||||||
|
|
||||||
log_test() ->
|
log_test() ->
|
||||||
?assertMatch(ok, log("D0001", [])),
|
log("D0001", []),
|
||||||
?assertMatch(ok, log_timer("D0001", [], os:timestamp())).
|
log_timer("D0001", [], os:timestamp()).
|
||||||
|
|
||||||
-endif.
|
-endif.
|
|
@ -162,7 +162,7 @@ code_change(_OldVsn, State, _Extra) ->
|
||||||
requestandhandle_work(State) ->
|
requestandhandle_work(State) ->
|
||||||
case leveled_penciller:pcl_workforclerk(State#state.owner) of
|
case leveled_penciller:pcl_workforclerk(State#state.owner) of
|
||||||
none ->
|
none ->
|
||||||
leveled_log:log("PC006", [self()]),
|
leveled_log:log("PC006", []),
|
||||||
{false, ?MAX_TIMEOUT};
|
{false, ?MAX_TIMEOUT};
|
||||||
WI ->
|
WI ->
|
||||||
{NewManifest, FilesToDelete} = merge(WI),
|
{NewManifest, FilesToDelete} = merge(WI),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue