Comments (3)
Hi @colinpilloud ! Right, I guess logging could use a better solution. For now I kept Console[F]
because skunk
currently also requires a console instance for logging, so you need one anyway. Can't tell at the moment why skunk is not using any logging APIs/frameworks.
You can actually still provide a custom Console[F]
instance which can use any logger underneath. I just created a branch with an example module on how you can get the logging via log4cats
with slf4j
and logback
ExampleSlf4jLogback.scala (if you want to try you can checkout the branch and run docker compose up -d && sbt exampleLog4Cats/run
). Would that suffice for your use case?
Good thing is that skunk logs will also get formatted using the same logger. One problem with that I guess is that you can't configure the logging for skunk and dumbo separately (e.g. keep dumbo logs, but mute skunk ones).
I am not sure it's worth it to add dependencies on logging frameworks for the few info/debug logs done from the same class in dumbo 🤔. One could maybe create a simple Logger interface like
package dumbo
trait Logger[F[_]] {
def info(message: String): F[Unit]
def error(message: String): F[Unit]
// add more when needed
}
for now and require that along with Console[F] for skunk.
One can then provide this logger instance using any logger underneath for dumbo and a separate console instance for skunk.
I'd rather consider dependency on log4cats if it gets more complex where a LoggerFactory
would be useful or skunk is going to add it to the core.
from dumbo.
Very useful example and will absolutely suffice for my needs! I thought something like this should be possible but couldn't quite fit the pieces together, so I appreciate you taking the time to put this together.
The Console[F]
requirement from skunk
is super interesting; I would love to research more about how skunk
suggests approaching logging for both libraries and apps and how other developers are doing things!
This probably doesn't need to remain open as an issue; I defer to you on the matter, although either way I appreciate your prompt reply!
from dumbo.
@colinpilloud just found that there was a conversation initiated on skunk discord channel about logging: link to message. Sounds like the plan is to use otel4s instead of log4cats.
I'd keep the issue open for now to have a think about it and gather ideas.
from dumbo.
Related Issues (12)
- Support native embedded resources HOT 1
- Add a command line interface HOT 1
- Add support for non-transactional operations HOT 1
- java.nio.file.FileSystemNotFoundException: null HOT 3
- Upgrade skunk to 1.x HOT 2
- Scan given location for migration scripts recursively
- Add comand line binary release for macOS (AArch64/ARM64 + x86-64)
- Add support for repeatable migrations
- Add command line docker build test in CI HOT 1
- Loading migration files from resources doesn't work on windows HOT 1
- Option to use `Typer.Strategy.BuiltinsOnly` to workaround bug in Skunk's oid codec? HOT 4
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 dumbo.