Skip to content

Commit

Permalink
add DefaultLoggerFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuv1Wolf committed May 9, 2024
1 parent 17fb6de commit 85bf887
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pip-services4-observability-go/component.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pip-services4-observability-go",
"type": "module",
"language": "go",
"version": "0.0.1",
"version": "0.0.2",
"build": 0,
"registry": "pipservices",
"artifacts": [
Expand Down
25 changes: 25 additions & 0 deletions pip-services4-observability-go/log/DefaultLoggerFactory.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package log

import (
"github.com/pip-services4/pip-services4-go/pip-services4-components-go/build"
"github.com/pip-services4/pip-services4-go/pip-services4-components-go/refer"
)

// Creates ILogger components by their descriptors.

var NullLoggerDescriptor = refer.NewDescriptor("pip-services", "logger", "null", "*", "1.0")
var ConsoleLoggerDescriptor = refer.NewDescriptor("pip-services", "logger", "console", "*", "1.0")
var CompositeLoggerDescriptor = refer.NewDescriptor("pip-services", "logger", "composite", "*", "1.0")

// NewDefaultLoggerFactory create a new instance of the factory.
//
// Returns: *build.Factory
func NewDefaultLoggerFactory() *build.Factory {
factory := build.NewFactory()

factory.RegisterType(NullLoggerDescriptor, NewNullLogger)
factory.RegisterType(ConsoleLoggerDescriptor, NewConsoleLogger)
factory.RegisterType(CompositeLoggerDescriptor, NewCompositeLogger)

return factory
}

0 comments on commit 85bf887

Please sign in to comment.