From 88d0f39ba10362744535ef48a1a90c483ffe43e9 Mon Sep 17 00:00:00 2001 From: "Kian-Meng, Ang" Date: Wed, 3 Nov 2021 08:35:32 +0800 Subject: [PATCH] Fix typos --- README.md | 10 +++++----- rebar.config | 2 +- src/error_logger_lager_h.erl | 6 +++--- src/lager.erl | 2 +- src/lager_common_test_backend.erl | 2 +- src/lager_default_formatter.erl | 2 +- src/lager_file_backend.erl | 4 ++-- src/lager_format.erl | 2 +- src/lager_transform.erl | 2 +- test/lager_test_backend.erl | 6 +++--- test/sync_error_logger.erl | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 0dd7d0b6..3a1655a6 100644 --- a/README.md +++ b/README.md @@ -218,7 +218,7 @@ will be applied on that sink. Custom Formatting ----------------- -All loggers have a default formatting that can be overriden. A formatter is any module that +All loggers have a default formatting that can be overridden. A formatter is any module that exports `format(#lager_log_message{},Config#any())`. It is specified as part of the configuration for the backend: @@ -653,7 +653,7 @@ record a module compiled with the lager parse transform knows about by using the lager:info("My state is ~p", [lager:pr(State, ?MODULE)]) ``` -Often, `?MODULE` is sufficent, but you can obviously substitute that for a literal module name. +Often, `?MODULE` is sufficient, but you can obviously substitute that for a literal module name. `lager:pr` also works from the shell. Colored terminal output @@ -791,7 +791,7 @@ A special log level, `silence` can be used together with a filter in order to suppress specific log output. This can be useful if a backend has been configured for a particular log level, but a particular set of log messages clutters the log. If these come from a dependency, they might be difficult -to remove entirely, and it might not be desireable to do so in general. +to remove entirely, and it might not be desirable to do so in general. In such situations, a trace filter with log level `silence` can turn them off selectively, while letting other messages through as before. @@ -1263,7 +1263,7 @@ Example Usage: * Bugfix: flush_threshold not working (#449) * Feature: Add `node` as a formatting option (#447) * Documentation: Update Elixir section with information about parse_transform (#446) - * Bugfix: Correct default console configuation to use "[{level,info}]" instead (#445) + * Bugfix: Correct default console configuration to use "[{level,info}]" instead (#445) * Feature: Pretty print lists of records at top level and field values with lager:pr (#442) * Bugfix: Ignore return value of lager:dispatch_log in lager.hrl (#441) @@ -1339,7 +1339,7 @@ Example Usage: 3.3.0 - 16 February 2017 - * Docs: Fix documentation to make 'it' unambiguous when discussing asychronous + * Docs: Fix documentation to make 'it' unambiguous when discussing asynchronous operation. (#387) * Test: Fix test flappiness due to insufficient sanitation between test runs (#384, #385) * Feature: Allow metadata only logging. (#380) diff --git a/rebar.config b/rebar.config index c3a639b5..f1250b4a 100644 --- a/rebar.config +++ b/rebar.config @@ -35,7 +35,7 @@ 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 + % is deliberately broken and will generate an un-maskable warning ]}. {erl_first_files, ["src/lager_util.erl"]}. diff --git a/src/error_logger_lager_h.erl b/src/error_logger_lager_h.erl index b6ef5a96..96d2fcfc 100644 --- a/src/error_logger_lager_h.erl +++ b/src/error_logger_lager_h.erl @@ -420,7 +420,7 @@ format_offender(Off) -> [Name, MFA, get_value(pid, Off)]) end. -%% backwards compatability shim +%% backwards compatibility shim format_reason(Reason) -> element(2, format_reason_md(Reason)). @@ -551,7 +551,7 @@ format_reason_md(Reason) -> {Str, _} = lager_trunc_io:print(Reason, 500), {[], Str}. -%% backwards compatability shim +%% backwards compatibility shim format_mfa(MFA) -> element(2, format_mfa_md(MFA)). @@ -575,7 +575,7 @@ format_mfa_md([{M, F, A}| _]) -> format_mfa_md([{M, F, A, Props}| _]) when is_list(Props) -> %% this kind of weird stacktrace can be generated by a uncaught throw in a gen_server %% TODO we might not always want to print the first MFA we see here, often it is more helpful - %% to print a lower one, but it is hard to programatically decide. + %% to print a lower one, but it is hard to programmatically decide. format_mfa_md({M, F, A, Props}); format_mfa_md(Other) -> {[], io_lib:format("~w", [Other])}. diff --git a/src/lager.erl b/src/lager.erl index 5562042f..d834f3cf 100644 --- a/src/lager.erl +++ b/src/lager.erl @@ -53,7 +53,7 @@ count :: infinity | pos_integer(), format_string :: string(), timeout :: infinity | pos_integer(), - started = os:timestamp() :: erlang:timestamp() %% use os:timestamp for compatability + started = os:timestamp() :: erlang:timestamp() %% use os:timestamp for compatibility }). %% API diff --git a/src/lager_common_test_backend.erl b/src/lager_common_test_backend.erl index 0e03d6f7..cf344a1b 100644 --- a/src/lager_common_test_backend.erl +++ b/src/lager_common_test_backend.erl @@ -13,7 +13,7 @@ bounce/0, bounce/1]). -%% holds the log messages for retreival on terminate +%% holds the log messages for retrieval on terminate -record(state, {level :: {mask, integer()}, formatter :: atom(), format_config :: any(), diff --git a/src/lager_default_formatter.erl b/src/lager_default_formatter.erl index 8ed2647b..94048dd7 100644 --- a/src/lager_default_formatter.erl +++ b/src/lager_default_formatter.erl @@ -381,7 +381,7 @@ basic_test_() -> [metadata] ))) }, - {"Metadata can be printed in its enterity with custom seperators", + {"Metadata can be printed in its enterity with custom separators", ?_assertEqual(iolist_to_binary(["bar->2, baz->3, foo->1"]), iolist_to_binary(format(lager_msg:new("Message", Now, diff --git a/src/lager_file_backend.erl b/src/lager_file_backend.erl index 6b1ab17d..040ace98 100644 --- a/src/lager_file_backend.erl +++ b/src/lager_file_backend.erl @@ -20,7 +20,7 @@ %% @doc File backend for lager, with multiple file support. %% Multiple files are supported, each with the path and the loglevel being -%% configurable. The configuration paramter for this backend is a list of +%% configurable. The configuration parameter for this backend is a list of %% key-value 2-tuples. See the init() function for the available options. %% This backend supports external and internal log %% rotation and will re-open handles to files if the inode changes. It will @@ -111,7 +111,7 @@ init([{FileName, LogLevel}, {Formatter,FormatterConfig}]) when is_list(FileName) init(LogFileConfig) when is_list(LogFileConfig) -> case validate_logfile_proplist(LogFileConfig) of false -> - %% falied to validate config + %% failed to validate config {error, {fatal, bad_config}}; Config -> %% probabably a better way to do this, but whatever diff --git a/src/lager_format.erl b/src/lager_format.erl index 3233554d..338abc2a 100644 --- a/src/lager_format.erl +++ b/src/lager_format.erl @@ -110,7 +110,7 @@ pad_char(Fmt, Args) -> {$\s,Fmt,Args}. %% collect_cc([FormatChar], [Argument]) -> %% {Control,[ControlArg],[FormatChar],[Arg]}. -%% Here we collect the argments for each control character. +%% Here we collect the arguments for each control character. %% Be explicit to cause failure early. collect_cc([$w|Fmt], [A|Args]) -> {$w,[A],Fmt,Args}; diff --git a/src/lager_transform.erl b/src/lager_transform.erl index bd035124..306469b8 100644 --- a/src/lager_transform.erl +++ b/src/lager_transform.erl @@ -182,7 +182,7 @@ do_transform(Line, SinkName, Severity, Arguments0, Safety) -> unsafe -> do_log_unsafe end, - %% Wrap the call to lager:dispatch_log/6 in case that will avoid doing any work if this message is not elegible for logging + %% Wrap the call to lager:dispatch_log/6 in case that will avoid doing any work if this message is not eligible for logging %% See lager.erl (lines 89-100) for lager:dispatch_log/6 %% case {whereis(Sink), whereis(?DEFAULT_SINK), lager_config:get({Sink, loglevel}, {?LOG_NONE, []})} of {'case',Line, diff --git a/test/lager_test_backend.erl b/test/lager_test_backend.erl index 78bee6cb..1c7d763e 100644 --- a/test/lager_test_backend.erl +++ b/test/lager_test_backend.erl @@ -437,9 +437,9 @@ lager_test_() -> ?assertEqual(0, count()), lager:trace(?MODULE, [{module, ?MODULE}], debug), ?assertMatch({?ERROR bor ?CRITICAL bor ?ALERT bor ?EMERGENCY, _}, lager_config:get(loglevel)), - %% elegible for tracing + %% eligible for tracing ok = lager:info("hello world"), - %% NOT elegible for tracing + %% NOT eligible for tracing ok = lager:log(info, [{pid, self()}], "hello world"), ?assertEqual(1, count()), ok @@ -943,7 +943,7 @@ test_body(Expected, Actual) -> "Trailing data \"~s\" following \"~s\"", [Rest, Expected]); {match, [{0, _}]} -> - % the whole sting is " line NNN" + % the whole string is " line NNN" ok; {match, [{Off, _}]} -> ?debugFmt( diff --git a/test/sync_error_logger.erl b/test/sync_error_logger.erl index 078000fb..bd1b609a 100644 --- a/test/sync_error_logger.erl +++ b/test/sync_error_logger.erl @@ -21,7 +21,7 @@ %% The error_logger API, but synchronous! %% This is helpful for tests, otherwise you need lots of nasty timer:sleep. %% Additionally, the warning map can be set on a per-process level, for -%% convienience, via the process dictionary value `warning_map'. +%% convenience, via the process dictionary value `warning_map'. -export([ info_msg/1, info_msg/2,