155 Commits

Author SHA1 Message Date
Steven Fackler
b16b5add69
Merge pull request #276 from sfackler/codegen
Optimize logging codegen
2018-06-04 22:40:02 -07:00
Ashley Mannix
8fcf3c2971
Merge pull request #274 from cowang4/master
Added Crate Feature Flags Documentation
2018-06-04 07:52:26 +10:00
Steven Fackler
8ca698f0a2 Optimize logging codegen
The extra work involved in loading the logger and creating the record
struct involves move codegen than is necessary if we take this kind of
approach (which we previously used in 0.3). It's a bit unfortunate to
have these public-but-not-public functions, but I think it's worth it.
We want to minimize the footprint of logging so people feel comfortable
using it!

A main function containing nothing but `warn!("hello world")` shrinks
from 204 bytes to 124 bytes in x86_64 with this change.

Closes #275
2018-06-03 10:58:52 -07:00
Greg Cowan
dc581888d9 backticks set_boxed_logger 2018-05-30 19:02:29 -04:00
Greg Cowan
24e151edd9 added crate feature flags documentation 2018-05-29 23:18:23 -04:00
Michal 'vorner' Vaner
3ed9a8e3a3
Shaving mutates the yak 2018-05-29 19:53:56 +02:00
Luke Horsley
3bd1f4e348 Better handling for deserializing invalid slices 2018-04-08 12:18:38 +01:00
Luke Horsley
033e46b1a2 Level and LevelFilter can now be deserialized from byte slices
This is required by some deserializers which deserialize identifiers using their binary representation.

This implementation should be equivalent to what serde derive would implement.
2018-04-08 11:59:07 +01:00
Steven Fackler
bdff1b0fd8 Fix max log level documentation
Closes #259
2018-02-09 21:53:51 -08:00
Malo Jaffré
ebc7f052f4 Fix broken links and bump the version to 0.4.1
Unblocks rust-lang/rust#46278.
2017-12-30 23:46:26 +01:00
Steven Fackler
bf40d1f563 Release 0.4.0 2017-12-24 14:47:34 -07:00
Steven Fackler
0b2a1c102c Fix a documentation typo 2017-12-24 11:18:53 -07:00
Thomas de Zeeuw
909d48acd0
Fix link to MetadataBuilder in RecordBuilder 2017-12-06 18:21:15 +01:00
Steven Fackler
4e30825439 Bump to 0.4.0-rc.1 2017-12-05 22:23:25 -08:00
Steven Fackler
14ac73118f
Merge pull request #245 from sfackler/simpler-init
Remove MaxLevelFilter in favor of a simple function
2017-12-05 21:30:46 -08:00
Steven Fackler
b1b5196775 Remove MaxLevelFilter in favor of a simple function
Closes #243
2017-12-05 21:22:22 -08:00
Steven Fackler
84198000c4 Make module_path, file, and line Options
Closes #242
2017-12-05 20:19:56 -08:00
Guillaume Gomez
e7247ba54e fix doc warnings 2017-11-10 01:39:38 +01:00
FuGangqiang
3a4f08db73 fix doc 2017-10-22 19:12:47 +08:00
Steven Fackler
367b6c3062 Remove static log config info from macro docs
It makes more sense to centrally locate that information.

Also run rustfmt.
2017-10-12 21:54:34 -07:00
Steven Fackler
401414af13 Better documentation for filter features
Closes #197
2017-10-12 21:35:46 -07:00
Steven Fackler
498a9444de Rename the use_std feature to std
Closes #176
2017-10-12 21:12:54 -07:00
Alex Crichton
c3334f8122 Merge pull request #232 from sfackler/doc-0.4
Add a note about version compatibility
2017-10-07 21:11:44 -05:00
Steven Fackler
213b85dab2 Add a note about version compatibility 2017-10-07 14:44:00 -07:00
Steven Fackler
6e2dcf38a5 Some minor tweaks 2017-10-05 19:39:48 -07:00
Steven Fackler
dc11b85c07 Restructure initialization setup
try_set_logger_raw is now set_logger and try_set_logger is now
set_boxed_logger. The use_std feature is now disabled by default. The
old set_logger has been removed.

When we did the crate evaluation for log, we wanted to add more variants
of set_logger that e.g. panicked by default, but I'm no longer convinced
that's a good idea. There are going to be very few instances of actually
calling these methods explicitly, since each logger implementation
should be providing their own init method that calls them. Having a huge
constellation of functions that all do basically the same thing just
makes things really confusing. We also don't want to encourage logger
implementations to only provide an init function that panics because a
common way of working with logging in tests is to try to init the system
in each test and ignore the result.
2017-09-30 21:31:07 -07:00
Steven Fackler
e3d8f25c8b Use a &'static Log rather than raw pointer
This allows us to make try_set_logger_raw a safe function. It turns out
that every example dealing with that function was violating the static
lifetime requirement. Fun!
2017-09-27 21:28:56 -07:00
Steven Fackler
3843fc9fc1 Don't force module_path and file strings to be static
Closes #206
Closes #94
2017-09-25 20:54:39 -07:00
Steven Fackler
20f1c82845 Merge pull request #208 from alisha17/set_logger_raw
Rename set_logger_raw to try_set_logger_raw
2017-09-17 14:13:35 -07:00
Ashley Mannix
1895c645c4 Remove env_logger crate (#224) 2017-09-18 07:03:00 +10:00
Alisha
308e6f33d6 Change set_logger_raw to try_set_logger_raw 2017-08-18 00:56:29 +10:00
Steven Fackler
c4faf3dbb0 Replace log and enabled functions with logger
We also have flush on the Log trait, and at that point it makes more
sense to just return the logger directly.
2017-08-13 13:21:11 -07:00
Steven Fackler
5332f71701 Add a secret bit of info for 0.3.x 2017-08-12 21:53:41 -07:00
Alex Crichton
814340617b Merge pull request #212 from sfackler/max-level-const
Turn __static_max_level() into a const
2017-08-12 11:15:19 -05:00
Steven Fackler
c538659838 Remove deprecated panic hook 2017-08-12 00:18:20 -07:00
Steven Fackler
3a846a6022 Turn __static_max_level() into a const 2017-08-12 00:13:52 -07:00
Steven Fackler
e33d923cc2 Make __log and __enabled public
They now take a `&Record` and `&Metadata` respectively. Shim libraries
from other logging frameworks will want to construct these types
directly rather than using the log macros.
2017-08-11 23:29:39 -07:00
Ottavio Hartman
549f47c9ff Create builders for Metadata and Record. Remove Level and inline its fields in Record. 2017-08-10 09:41:35 -04:00
dan pittman
44bbdbd93b
removes shutdown and adds flush to Log trait.
Signed-off-by: dan pittman <danielscottt@gmail.com>
2017-07-17 08:38:02 -07:00
jesusbv
d3aa95b4c4 logging levels and coresponding macros 2017-07-12 08:57:19 +01:00
Alisha
a1e0bcacef set_logger panics on error 2017-06-22 10:53:05 +10:00
Brian Anderson
26d6497965 Merge pull request #195 from budziq/no_framework
Toned down the references to the "frameworks"
2017-06-19 16:39:00 -05:00
Michal Budzynski
7b11893779 expanded log! docs for max_level_* 2017-06-07 23:18:56 +02:00
Michal Budzynski
c75c587008 Toned down the references to the "frameworks"
Also added link to pretty_env_logger as it has good docs now.
2017-06-04 18:56:15 +02:00
Michal Budzynski
0831c0b6c8 Corrected header level for "Example" sections 2017-06-03 09:40:23 +02:00
Michal Budzynski
fb9f3a0d10 Added "Errors" section to set_logger docs 2017-06-02 22:47:07 +02:00
David Tolnay
255cf726e0 Merge pull request #188 from budziq/sinks_docs
Added links to logging frameworks
2017-06-02 12:36:07 -07:00
Michal Budzynski
969107c313 Added links to logging frameworks 2017-06-02 21:25:44 +02:00
David Tolnay
48d7714a9d Merge pull request #189 from nivkner/parse-link
add link to from_str method in ParseLevelError
2017-06-02 11:23:57 -07:00
David Tolnay
c838a58ad9 Merge pull request #190 from nivkner/set-logger-raw
improve docs of set_logger_raw function
2017-06-02 08:13:32 -07:00