Skip to content

Commit

Permalink
Change log level from "info" to "debug" (#488)
Browse files Browse the repository at this point in the history
Closes #481
  • Loading branch information
philss authored Oct 5, 2023
1 parent 3ae6a57 commit 9c85bd2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@ There are also some selectors based on non-standard specifications. They are:
| E:fl-contains('foo') | an E element that contains "foo" inside a text node |
| E:fl-icontains('foo') | an E element that contains "foo" inside a text node (case insensitive) |

## Suppressing log messages

Floki may log debug messages related to problems in the parsing of selectors, or parsing of the HTML tree.
It also may log some "info" messages related to deprecated APIs. If you want to suppress these log messages,
please consider setting the `:compile_time_purge_matching` option for `:logger` in your compile time configuration.

See https://hexdocs.pm/logger/Logger.html#module-compile-configuration for details.

## Special thanks

* [@arasatasaygin](https://github.com/arasatasaygin) for Floki's logo from the [Open Logos project](http://openlogos.org/).
Expand Down
2 changes: 0 additions & 2 deletions lib/floki/finder.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
defmodule Floki.Finder do
require Logger

@moduledoc false

# The finder engine traverse the HTML tree searching for nodes matching
Expand Down
2 changes: 1 addition & 1 deletion lib/floki/selector.ex
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ defmodule Floki.Selector do
end

defp pseudo_class_match?(_html_node, %{name: unknown_pseudo_class}, _tree) do
Logger.info(fn ->
Logger.debug(fn ->
"Pseudo-class #{inspect(unknown_pseudo_class)} is not implemented. Ignoring."
end)

Expand Down
6 changes: 3 additions & 3 deletions lib/floki/selector/parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ defmodule Floki.Selector.Parser do
end

defp do_parse([{:unknown, _, unknown} | t], selector) do
Logger.info(fn -> "Unknown token #{inspect(unknown)}. Ignoring." end)
Logger.debug(fn -> "Unknown token #{inspect(unknown)}. Ignoring." end)

do_parse(t, selector)
end
Expand Down Expand Up @@ -179,7 +179,7 @@ defmodule Floki.Selector.Parser do
end

defp consume_attribute(:consuming, [unknown | t], attr_selector) do
Logger.info(fn -> "Unknown token #{inspect(unknown)}. Ignoring." end)
Logger.debug(fn -> "Unknown token #{inspect(unknown)}. Ignoring." end)
consume_attribute(:consuming, t, attr_selector)
end

Expand Down Expand Up @@ -264,7 +264,7 @@ defmodule Floki.Selector.Parser do
end

defp update_pseudo_not_value(_pseudo_class, _pseudo_not_selector) do
Logger.info("Only simple selectors are allowed in :not() pseudo-class. Ignoring.")
Logger.debug("Only simple selectors are allowed in :not() pseudo-class. Ignoring.")
nil
end
end
2 changes: 1 addition & 1 deletion lib/floki/selector/pseudo_class.ex
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ defmodule Floki.Selector.PseudoClass do
relative_position in s

expression ->
Logger.info(fn ->
Logger.debug(fn ->
"Pseudo-class #{name} with expressions like #{inspect(expression)} are not supported yet. Ignoring."
end)

Expand Down

0 comments on commit 9c85bd2

Please sign in to comment.