Skip to content

Commit

Permalink
Add new constructor for client with log config as parameter (#117)
Browse files Browse the repository at this point in the history
* NewClientWithLogsConfig

* NewClientWithLogsConfig
  • Loading branch information
ToniRamirezM authored Mar 21, 2024
1 parent ebf261c commit 0c30017
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions datastreamer/streamclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ func NewClient(server string, streamType StreamType) (*StreamClient, error) {
return &c, nil
}

// NewClientWithLogsConfig creates a new data stream client with logs configuration
func NewClientWithLogsConfig(server string, streamType StreamType, logsConfig log.Config) (*StreamClient, error) {
log.Init(logsConfig)
return NewClient(server, streamType)
}

// Start connects to the data stream server and starts getting data from the server
func (c *StreamClient) Start() error {
// Connect to server
Expand Down

0 comments on commit 0c30017

Please sign in to comment.