1# Change Log 2 3## [Unreleased] 4 5## [0.4.8] - 2019-07-28 6 7### New 8 9* Support attempting to get `Record` fields as static strings. 10 11## [0.4.7] - 2019-07-06 12 13### New 14 15* Support for embedded environments with thread-unsafe initialization. 16* Initial unstable support for capturing structured data under the `kv_unstable` 17feature gate. This new API doesn't affect existing users and may change in future 18patches (so those changes may not appear in the changelog until it stabilizes). 19 20### Improved 21 22* Docs for using `log` with the 2018 edition. 23* Error messages for macros missing arguments. 24 25## [0.4.6] - 2018-10-27 26 27### Improved 28 29* Support 2018-style macro import for the `log_enabled!` macro. 30 31## [0.4.5] - 2018-09-03 32 33### Improved 34 35* Make `log`'s internal helper macros less likely to conflict with user-defined 36 macros. 37 38## [0.4.4] - 2018-08-17 39 40### Improved 41 42* Support 2018-style imports of the log macros. 43 44## [0.4.3] - 2018-06-29 45 46### Improved 47 48* More code generation improvements. 49 50## [0.4.2] - 2018-06-05 51 52### Improved 53 54* Log invocations now generate less code. 55 56### Fixed 57 58* Example Logger implementations now properly set the max log level. 59 60## [0.4.1] - 2017-12-30 61 62### Fixed 63 64* Some doc links were fixed. 65 66## [0.4.0] - 2017-12-24 67 68The changes in this release include cleanup of some obscure functionality and a more robust public 69API designed to support bridges to other logging systems, and provide more flexibility to new 70features in the future. 71 72### Compatibility 73 74Vast portions of the Rust ecosystem use the 0.3.x release series of log, and we don't want to force 75the community to go through the pain of upgrading every crate to 0.4.x at the exact same time. Along 76with 0.4.0, we've published a new 0.3.9 release which acts as a "shim" over 0.4.0. This will allow 77crates using either version to coexist without losing messages from one side or the other. 78 79There is one caveat - a log message generated by a crate using 0.4.x but consumed by a logging 80implementation using 0.3.x will not have a file name or module path. Applications affected by this 81can upgrade their logging implementations to one using 0.4.x to avoid losing this information. The 82other direction does not lose any information, fortunately! 83 84**TL;DR** Libraries should feel comfortable upgrading to 0.4.0 without treating that as a breaking 85change. Applications may need to update their logging implementation (e.g. env-logger) to a newer 86version using log 0.4.x to avoid losing module and file information. 87 88### New 89 90* The crate is now `no_std` by default. 91* `Level` and `LevelFilter` now implement `Serialize` and `Deserialize` when the `serde` feature is 92 enabled. 93* The `Record` and `Metadata` types can now be constructed by third-party code via a builder API. 94* The `logger` free function returns a reference to the logger implementation. This, along with the 95 ability to construct `Record`s, makes it possible to bridge from another logging framework to 96 this one without digging into the private internals of the crate. The standard `error!` `warn!`, 97 etc, macros now exclusively use the public API of the crate rather than "secret" internal APIs. 98* `Log::flush` has been added to allow crates to tell the logging implementation to ensure that all 99 "in flight" log events have been persisted. This can be used, for example, just before an 100 application exits to ensure that asynchronous log sinks finish their work. 101 102### Removed 103 104* The `shutdown` and `shutdown_raw` functions have been removed. Supporting shutdown significantly 105 complicated the implementation and imposed a performance cost on each logging operation. 106* The `log_panics` function and its associated `nightly` Cargo feature have been removed. Use the 107 [log-panics](https://crates.io/crates/log-panics) instead. 108 109### Changed 110 111* The `Log` prefix has been removed from type names. For example, `LogLevelFilter` is now 112 `LevelFilter`, and `LogRecord` is now `Record`. 113* The `MaxLogLevelFilter` object has been removed in favor of a `set_max_level` free function. 114* The `set_logger` free functions have been restructured. The logger is now directly passed to the 115 functions rather than a closure which returns the logger. `set_logger` now takes a `&'static 116 Log` and is usable in `no_std` contexts in place of the old `set_logger_raw`. `set_boxed_logger` 117 is a convenience function which takes a `Box<Log>` but otherwise acts like `set_logger`. It 118 requires the `std` feature. 119* The `file` and `module_path` values in `Record` no longer have the `'static` lifetime to support 120 integration with other logging frameworks that don't provide a `'static` lifetime for the 121 equivalent values. 122* The `file`, `line`, and `module_path` values in `Record` are now `Option`s to support integration 123 with other logging frameworks that don't provide those values. 124 125### In the Future 126 127* We're looking to add support for *structured* logging - the inclusion of extra key-value pairs of 128 information in a log event in addition to the normal string message. This should be able to be 129 added in a backwards compatible manner to the 0.4.x series when the design is worked out. 130 131## Older 132 133Look at the [release tags] for information about older releases. 134 135[Unreleased]: https://github.com/rust-lang-nursery/log/compare/0.4.8...HEAD 136[0.4.8]: https://github.com/rust-lang-nursery/log/compare/0.4.7...0.4.8 137[0.4.7]: https://github.com/rust-lang-nursery/log/compare/0.4.6...0.4.7 138[0.4.6]: https://github.com/rust-lang-nursery/log/compare/0.4.5...0.4.6 139[0.4.5]: https://github.com/rust-lang-nursery/log/compare/0.4.4...0.4.5 140[0.4.4]: https://github.com/rust-lang-nursery/log/compare/0.4.3...0.4.4 141[0.4.3]: https://github.com/rust-lang-nursery/log/compare/0.4.2...0.4.3 142[0.4.2]: https://github.com/rust-lang-nursery/log/compare/0.4.1...0.4.2 143[0.4.1]: https://github.com/rust-lang-nursery/log/compare/0.4.0...0.4.1 144[0.4.0]: https://github.com/rust-lang-nursery/log/compare/0.3.8...0.4.0 145[release tags]: https://github.com/rust-lang-nursery/log/releases 146