Skip to content

Conversation

@schmidtw
Copy link
Member

…ting it to an external library.

@schmidtw schmidtw requested a review from johnabass December 11, 2024 08:40
@codecov
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 78.66667% with 16 lines in your changes missing coverage. Please review.

Project coverage is 29.48%. Comparing base (6734389) to head (e444077).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
skeleton.go 0.00% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #4      +/-   ##
==========================================
+ Coverage   24.39%   29.48%   +5.09%     
==========================================
  Files          16       16              
  Lines         574      675     +101     
==========================================
+ Hits          140      199      +59     
- Misses        416      458      +42     
  Partials       18       18              
Flag Coverage Δ
unittests 29.48% <78.66%> (+5.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


// Module is function that builds the loggerfx module based on the inputs. If
// the configPath is not provided then the default path is used.
func Module(configPath ...string) fx.Option {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good pattern, but not something we want to import into every application. This is the kind of code that belongs in each application that uses these libraries.

The main reason for this is you cannot know a priori how an application is going to organize its modules. An application might put each http.Server in its own module, for example.


// DefaultConfig is a helper function that creates a default sallust configuration
// for the logger based on the application name.
func DefaultConfig(appName string) sallust.Config {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good convention, but it should stay a convention. I'm ok with this being in skeleton, but we should express a dependency on this library via go.mod

//
// Make sure to include this option last in the fx.Options list, so that the
// logger is the last component to be shutdown.
func SyncOnShutdown() fx.Option {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what value this provides, since sallust provides the option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants