config :logger, :my_logger,
level: :info,
applications: [
library1: :debug
]
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/606029ea-9855-44c6-ba94-69113ffed45c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/61adb36f-e448-46c2-abf9-b1a5757a14d3%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/ddf53d78-124b-4adb-8f6f-6deb5a52d0eb%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/8ca8d1ce-8996-4b55-923b-f8e0b99bf054%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/b108e778-e883-4ab3-99d6-6f1bb215123c%40googlegroups.com.
Logs such as every message to a GenServer (any any other OTP behaviour) are already provided by OTP and can be enabled without any changes to code with:sys.trace(pid, true)There's also the VM function & process tracing. I don't think adding logs for things like that is actually useful when we have such powerful tools provided by the runtime.
Michał.
Having recently made the journey from Java to Elixir I was also struck by the inflexibility of the built-in logging framework. The inability to configure log levels per module/application lead me to create FlexLogger (https://hex.pm/packages/flex_logger) which, however, is a crude substitute for a built-in solution with compile-time purging as it performs run-time checks.--Besides, I would also like to argue for an extra log level for trace messages. While usually the existing log levels are sufficient there are cases where you would like to have the ability to, for example, log every single message coming to a genserver. For most cases this would be a total overkill of messages and in particular the high amount might lead to logs being unreadable. But for understanding what goes on in this particular genserver these kinds of logs could be invaluable. For now, I am usually commenting out debug messages of the trace type (or most often I am actually deleting them once I think everything is fine) and add them back when needed. So I for one would be very happy with an additional log level (especially in combination with module/application specific setting of log levels).Arno
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/b108e778-e883-4ab3-99d6-6f1bb215123c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/7da2b127-bd8f-4121-ae02-c25215cd4a98%40Spark.To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
I agree, for the scenario Arno describes, using the tracing tools is a more appropriate approach rather than logging, as you almost certainly want to only trace messages matching a certain pattern to prevent overload. I'm not sure I think a trace log level makes much sense when for the things you would use it for, are tracing activities that you would use the tracing tools for instead. This is a bit of a switch from say Java, where you don't have the runtime tracing tools that OTP has, and it makes sense to have tracing logs to fill the gap.Paul
On Sun, Dec 10, 2017 at 1:57 PM, Michał Muskała <mic...@muskala.eu> wrote:
Logs such as every message to a GenServer (any any other OTP behaviour) are already provided by OTP and can be enabled without any changes to code with:sys.trace(pid, true)There's also the VM function & process tracing. I don't think adding logs for things like that is actually useful when we have such powerful tools provided by the runtime.
Michał.
Having recently made the journey from Java to Elixir I was also struck by the inflexibility of the built-in logging framework. The inability to configure log levels per module/application lead me to create FlexLogger (https://hex.pm/packages/flex_logger) which, however, is a crude substitute for a built-in solution with compile-time purging as it performs run-time checks.--Besides, I would also like to argue for an extra log level for trace messages. While usually the existing log levels are sufficient there are cases where you would like to have the ability to, for example, log every single message coming to a genserver. For most cases this would be a total overkill of messages and in particular the high amount might lead to logs being unreadable. But for understanding what goes on in this particular genserver these kinds of logs could be invaluable. For now, I am usually commenting out debug messages of the trace type (or most often I am actually deleting them once I think everything is fine) and add them back when needed. So I for one would be very happy with an additional log level (especially in combination with module/application specific setting of log levels).Arno
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/b108e778-e883-4ab3-99d6-6f1bb215123c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
use MyLogger
MyLogger.info :category1,"log message"
MyLogger.debug :category2,"some #{inspect expensive}operation"
MyLogger.warn"always displayed when :warn level set"