Skip to content

Commit

Permalink
make utf8 for "~tp"
Browse files Browse the repository at this point in the history
  • Loading branch information
mspiridonov committed Apr 20, 2016
1 parent b7984d4 commit ac9fc41
Show file tree
Hide file tree
Showing 26 changed files with 2,596 additions and 881 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ log
deps
.local_dialyzer_plt
dialyzer_unhandled_warnings
dialyzer_warnings
dialyzer_warnings
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
sudo: false
language: erlang
notifications:
webhooks: http://basho-engbot.herokuapp.com/travis?key=8c2550739c2f776d4b05d993aa032f0724fe5450
email: [email protected]
otp_release:
- R16B
- 18.2.1
- 17.5
- R16B03-1
- R15B03
- R15B01
- R15B
- R14B04
- R14B03
414 changes: 344 additions & 70 deletions README.md

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions dialyzer.ignore-warnings

This file was deleted.

25 changes: 24 additions & 1 deletion include/lager.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@

-define(DEFAULT_TRUNCATION, 4096).
-define(DEFAULT_TRACER, lager_default_tracer).
-define(DEFAULT_SINK, lager_event).
-define(ERROR_LOGGER_SINK, error_logger_lager_event).


-define(LEVELS,
[debug, info, notice, warning, error, critical, alert, emergency, none]).

%% Use of these "functions" means that the argument list will not be
%% truncated for safety
-define(LEVELS_UNSAFE,
[{debug_unsafe, debug}, {info_unsafe, info}, {notice_unsafe, notice}, {warning_unsafe, warning}, {error_unsafe, error}, {critical_unsafe, critical}, {alert_unsafe, alert}, {emergency_unsafe, emergency}]).

-define(DEBUG, 128).
-define(INFO, 64).
-define(NOTICE, 32).
Expand Down Expand Up @@ -55,6 +63,9 @@
?EMERGENCY -> emergency
end).

-define(SHOULD_LOG(Sink, Level),
(lager_util:level_to_num(Level) band element(1, lager_config:get({Sink, loglevel}, {?LOG_NONE, []}))) /= 0).

-define(SHOULD_LOG(Level),
(lager_util:level_to_num(Level) band element(1, lager_config:get(loglevel, {?LOG_NONE, []}))) /= 0).

Expand All @@ -63,7 +74,7 @@
Level,
[{pid,Pid},{line,?LINE},{file,?FILE},{module,?MODULE}],
[])}
)).
)).

%% FOR INTERNAL USE ONLY
%% internal non-blocking logging call
Expand Down Expand Up @@ -100,3 +111,15 @@
end)).
-endif.

-record(lager_shaper, {
%% how many messages per second we try to deliver
hwm = undefined :: 'undefined' | pos_integer(),
%% how many messages we've received this second
mps = 0 :: non_neg_integer(),
%% the current second
lasttime = os:timestamp() :: erlang:timestamp(),
%% count of dropped messages this second
dropped = 0 :: non_neg_integer()
}).

-type lager_shaper() :: #lager_shaper{}.
52 changes: 48 additions & 4 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,12 +1,56 @@
{erl_opts, [debug_info, warn_untyped_record]}.
%% -*- erlang -*-
%% -------------------------------------------------------------------
%%
%% Copyright (c) 2011-2015 Basho Technologies, Inc.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing,
%% software distributed under the License is distributed on an
%% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
%% KIND, either express or implied. See the License for the
%% specific language governing permissions and limitations
%% under the License.
%%
%% -------------------------------------------------------------------

{erl_opts, [
{lager_extra_sinks, ['__lager_test_sink']},
debug_info,
report,
verbose,
warn_deprecated_function,
warn_deprecated_type,
warn_export_all,
warn_export_vars,
warn_obsolete_guard,
warn_untyped_record,
warn_unused_import
% do NOT include warnings_as_errors, as rebar includes these options
% when compiling for eunit, and at least one test module has code that
% is deliberatly broken and will generate an un-maskable warning
]}.

{erl_first_files, ["src/lager_util.erl"]}.

{eunit_opts, [verbose]}.
{eunit_compile_opts, [
nowarn_untyped_record,
nowarn_export_all
]}.
{deps, [
{goldrush, "0\.1\.6",
{git, "git://github.com/DeadZen/goldrush.git", {tag, "0.1.6"}}}
]}.
{goldrush, ".*", {git, "git://github.com/DeadZen/goldrush.git", {tag, "0.1.8"}}}
]}.

{xref_checks, []}.
{xref_queries, [{"(XC - UC) || (XU - X - B - lager_default_tracer : Mod - erlang:\"(is_map|map_size)\"/1 - maps:to_list/1)", []}]}.

{cover_enabled, true}.
{edoc_opts, [{stylesheet_file, "./priv/edoc.css"}]}.

{eunit_opts, [verbose]}.
Loading

0 comments on commit ac9fc41

Please sign in to comment.