Comments (1)
Hi there 👋 I agree this is a very important thing to add!
Personally, I would add a few more requirements that would be super nice to have:
- Automatically logging uncaught errors in handlers in the correct format
- Included middleware so it works "out of the box"
Because of these, I propose we use something like this repository that I set up to demonstrate how I think a dart_frog logger should work. You can check it out now - instructions are in the README (although I haven't published it to pub.dev yet so you'll have to add it as a git dependency for now).
A few reasons I think this is a great solution:
- It covers all the requirements laid out in the issue and my comment
- It exposes a simple
typedef
LogFormatter
so that it's super easy to define your own log style if you'd like - In a separate library, it includes a built-in support for Google Cloud Logging and a simple log format for local development
- It includes information like source location and stacktraces in the logs
- It uses
very_good_analysis
and has 100% coverage - It only depends on
shelf
and notdart_frog
so it works just as well with a raw shelf API
Lastly, I really think it's good to have the logger not built into the framework but instead as a separate package that can be added in through middleware.
The bold part of me proposes we migrate the existing repository to the /packages
directory and rename it dart_frog_logger
. I could also write a page on the docs site showing how to use it.
Let me know what you think 💙 I'm sure my package isn't perfect, but hopefully can at least share ideas and at most make this a super easy ticket to close 😎
from dart_frog.
Related Issues (20)
- fix: Test cases failing in dart_frog_cli while running dart test(OS errors)
- fix: need clarity around static files HOT 6
- chore: Dart Frog CLI 1.2.0 release
- max number of websockets HOT 3
- fix: Concurrency Issues HOT 2
- CI / CD Workflow Examples HOT 2
- Dart frog support Isolates ? HOT 1
- docs: Add Globe to Deployment section in Docs
- How to inject variables into context in a certain route HOT 4
- feat: allow $ in `new` commands
- fix: `dart_frog build` fails with "name" field doesn't match expected name HOT 1
- feat: Scheduled Tasks / Cron Jobs
- feat: add global exception catching HOT 6
- fix: Error parsing request HOT 2
- fix: zsh: command not found: dart_frog HOT 4
- chore: Release for Dart Frog CLI and Package HOT 1
- fix: When deploying to globe getting issue as: A directory corresponding to fileSystemPath "public" could not be found HOT 5
- docs: an overview document for dart_frog_cli
- fix: dart_frog dev -H HOT 1
- fix: ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 61), address = 127.0.0.1, port = 57735, uri=http://127.0.0.1:57715/status HOT 1
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 dart_frog.