Comments (8)
This is another case of an issue that is the growing features in the StreamLogHandler
in a package that was intended to be an "API only" package 😟 To be honest tend to think it would have been much better if this package never provided any implementation at all I keep thinking (as we did with http://reactive-streams.org)...
I could be convinced that this is small enough to consider "this is small enough", but overall I'm worried we're going down the wrong path growing features here, rather than collaborating on a full blown stream (stdout and/or file) LogHandler
, with configuration, output formatting etc. I'm also worried about setting too much precedent about: using "mainly" env as source of logging/config (does not scale to actually configuring many loggers) and naming convention here, though perhaps these are a lesser worry here.
I would love to see us come up and collaborate with a "serious" log handler implementation that would supersede all of the ones that are provided in here. Should we set something like that up and try to collaborate on getting a "real world" nice stream handler as a separate package?
TL;DR; IMHO: This library really should not become the best stream/stdout/file logger. It should be just the bare minimum APIs and be pretty limited such that it is well apparent that using a different "serious" backend is recommended, and we should make such one happen -- who's interested?
from swift-log.
I'm going to close this because this is an API package. More thoughts here: https://forums.swift.org/t/thoughts-on-why-does-swiftlog-not-have-multiple-log-destinations-formatters-colouring-some-other-feature/37507
from swift-log.
No objection from me to the principle of the feature, although I would suggest we make the name a bit less generic to avoid collisions with any other software that might be in the picture - perhaps SWIFT_LOG_LOGLEVEL
.
I bet @weissi will be against this though as he wants to keep the default logger super minimal and basic.
from swift-log.
Just because he doesn't use it! :-) SWIFT_LOG_LOGLEVEL
as yet another layer sounds OK, but it should still fallback to LOGLEVEL IMO.
from swift-log.
This would be quite handy for on-the-fly tweaking. I get the reasoning for keeping the default implementation simple but think there are enough "best practices" we should encourage that I'd like to see something that encapsulates things like this 🤔
from swift-log.
Just this afternoon (I’m very slow after the holidays 😅 ) I came across another Issue where you explained this rationale; and that finally clicked for me. Totally down for separating this as an “API package” vs another “default” one.
I think I’d just love there to be a default robust one! I don’t have cycles to lead the charge (unless no one else does), but happy to contribute!
from swift-log.
Sorry for the delay, I agree with @ktoso . I really don't want to encourage users to use the default backend so I'm -1 on the proposed change here. @helje5 why don't you make a new backend that literally starts with a copy & pasted version of the StreamLogHandler
?
from swift-log.
Yeah, I just replaced my own logging implementation with this one, my expectations have been a little wrong I guess :-) I can do my own.
TBH I'd very much prefer if swift-log itself comes with a reasonable default implementation(s). But maybe what's reasonable is too hard to agree on :-)
from swift-log.
Related Issues (20)
- Crash when using error log / Incomplete LogHandler implementation HOT 2
- Infinite recursion between deprecated API's HOT 4
- MultiplexLogHandler to learn about metadata providers
- Add new Discord Logger to README HOT 2
- Make `StdioOutputStream` public HOT 1
- Supported way of accumulating metadata down the callstack HOT 9
- Logging function autoclosures aren't "rethrows" HOT 8
- Simplify logging `Error` types HOT 4
- Support advanced loghandler metadata use cases HOT 2
- Make StreamLogHandler initializers public
- How should I disclose using Swift Log in my iOS app?
- Unsupported runtime for visionOS HOT 1
- Fails to compile on Fedora 39 with Swift 5.8.1 (From repos) or official 5.9 binaries HOT 7
- PrivacyInfo Manifest HOT 2
- visionOS Compatibility HOT 1
- "Unsupported Runtime" when compiling for xrOS HOT 2
- Adding Error to log functions HOT 2
- CoW (copy-on-write) box the `Logger` components (for perf) HOT 2
- .string and .stringConvertable metadata value equality HOT 7
- Build fails when BUILD_LIBRARY_FOR_DISTRIBUTION is set to YES HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-log.