<commit_before>% Copyright (c) 2010, NorthScale, Inc.
% All rights reserved.

-module(ns_log).

-export([log/3, log/4]).

-include_lib("eunit/include/eunit.hrl").

%% API

% A Code is an number which is module-specific.
%
log(Module, Code, Msg) ->
    error_logger:info_msg("~p-~p: ~p", [Module, Code, Msg]),
    ok.

log(Module, Code, Fmt, Args) ->
    error_logger:info_msg("~p-~p: " ++ Fmt, [Module, Code | Args]),
    ok.

% TODO: Implement this placeholder api, possibly as a gen_server
%       to track the last few log msgs in memory.  A client then might
%       want to do a rpc:multicall to gather all the recent log entries.

% ------------------------------------------

log_test() ->
    ok = log(?MODULE, 1, "test log"),
    ok = log(?MODULE, 2, "test log ~p ~p", [x, y]),
    ok.<commit_msg>Log API.<commit_after>% Copyright (c) 2010, NorthScale, Inc.
% All rights reserved.

-module(ns_log).

-export([log/3, log/4, recent/0]).

-include_lib("eunit/include/eunit.hrl").

%% API

% A Code is an number which is module-specific.
%
-spec log(atom(), integer(), string()) -> ok.
log(Module, Code, Msg) ->
    error_logger:info_msg("~p-~p: ~p", [Module, Code, Msg]),
    ok.

-spec log(atom(), integer(), string(), list()) -> ok.
log(Module, Code, Fmt, Args) ->
    error_logger:info_msg("~p-~p: " ++ Fmt, [Module, Code | Args]),
    ok.

-spec recent() -> list({atom(), integer(), string(), list()}).
recent() ->
    [].

% TODO: Implement this placeholder api, possibly as a gen_server
%       to track the last few log msgs in memory.  A client then might
%       want to do a rpc:multicall to gather all the recent log entries.

% ------------------------------------------

log_test() ->
    ok = log(?MODULE, 1, "test log"),
    ok = log(?MODULE, 2, "test log ~p ~p", [x, y]),
    ok.
{'fraction_non_alphanumeric': 0.21987784564131038, 'fraction_numerical': 0.009439200444197668, 'mean_word_length': 2.66260162601626, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5124806', 'n_tokens_mistral': 640, 'n_tokens_neox': 630, 'n_words': 201}