Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONObjLogger ¶
type JSONObjLogger struct {
// contains filtered or unexported fields
}
func (*JSONObjLogger) Close ¶
func (jol *JSONObjLogger) Close() error
Close will flush the file output and close the file handle. The caller should not operate on the JSON logger after calling Close. Close will return an error if the ojbect is already closed or has not be initalized.
func (*JSONObjLogger) Log ¶
func (jol *JSONObjLogger) Log(id, method string, obj interface{}) error
Log records a request path, method, and the objects sent and received. The output JSON will be encoded with tab indentation and a newline betwen objects.
type NilObjLogger ¶
type NilObjLogger struct { }
NillObjLogger is an empty implementation of the ObjLog interface for use when no logging is desired.
func (*NilObjLogger) Close ¶
func (nol *NilObjLogger) Close() error
Close implements the Close method on the interface, NilObjLogger does nothing.
func (*NilObjLogger) Log ¶
func (nol *NilObjLogger) Log(id, method string, obj interface{}) error
Log implements the Log method on the interface, NilObjLogger does nothing.
type ObjLog ¶
ObjLog is the interfaced used by the command line client so that all API requests and responses can be logged during normal operation. This interface is useful for debugging, development, and tracing the Gravwell request API.
func NewJSONLogger ¶
NewJSONLogger initializes an ObjLog compatible interface for logging request and response objects. The JSON logger will open a file in append mode and log requests, including their request and response objects. The output will be compact JSON encoded objects.
func NewNilLogger ¶
NewNilLogger generates an empty/do nothing logger that implements the ObjLog interface.