Get server logs sending over the socket. wowee
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"github.com/olebedev/emitter"
|
||||
"github.com/patrickmn/go-cache"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/pterodactyl/wings/config"
|
||||
@@ -60,6 +61,8 @@ type Server struct {
|
||||
// Server cache used to store frequently requested information in memory and make
|
||||
// certain long operations return faster. For example, FS disk space usage.
|
||||
cache *cache.Cache
|
||||
|
||||
emitter *emitter.Emitter
|
||||
}
|
||||
|
||||
// The build settings for a given server that impact docker container creation and
|
||||
@@ -257,3 +260,13 @@ func (s *Server) IsBootable() bool {
|
||||
func (s *Server) CreateEnvironment() error {
|
||||
return s.environment.Create()
|
||||
}
|
||||
|
||||
// Returns the server event emitter instance. If one has not been setup yet, a new instance
|
||||
// will be created.
|
||||
func (s *Server) Emitter() *emitter.Emitter {
|
||||
if s.emitter == nil {
|
||||
s.emitter = &emitter.Emitter{}
|
||||
}
|
||||
|
||||
return s.emitter
|
||||
}
|
||||
Reference in New Issue
Block a user