func (sl *SessionLogger) Write(bytes []byte) (written int, err error) {
	if sl.streamFile == nil {
		err := trace.Errorf("session %v error: attempt to write to a closed file", sl.sid)
		return 0, trace.Wrap(err)
	}
	if written, err = sl.streamFile.Write(bytes); err != nil {
		log.Error(err)
		return written, trace.Wrap(err)
	}
	// log this as a session event (but not more often than once a sec)
	sl.LogEvent(EventFields{
		EventType:              SessionPrintEvent,
		SessionPrintEventBytes: len(bytes)})

	// increase the total lengh of the stream
	atomic.AddInt64(&sl.writtenBytes, int64(len(bytes)))
	return written, nil
}
// Write takes a stream of bytes (usually the output from a session terminal)
// and writes it into a "stream file", for future replay of interactive sessions.
Write takes a stream of bytes (usually the output from a session terminal)
and writes it into a "stream file", for future replay of interactive sessions.
// Write takes a stream of bytes ( usually the output from a session terminal ) // and writes it into a " stream file " for future replay of interactive sessions .
func (sl *SessionLogger) Write(bytes []byte) (written int, err error) {
	if sl.streamFile == nil {
		err := trace.Errorf("session %v error: attempt to write to a closed file", sl.sid)
		return 0, trace.Wrap(err)
	}
	if written, err = sl.streamFile.Write(bytes); err != nil {
		log.Error(err)
		return written, trace.Wrap(err)
	}
	sl.LogEvent(EventFields{
		EventType:              SessionPrintEvent,
		SessionPrintEventBytes: len(bytes)})
	atomic.AddInt64(&sl.writtenBytes, int64(len(bytes)))
	return written, nil
}
func ( sl * SessionLogger ) Write ( bytes [ ] byte ) ( written int , err error ) { if sl . streamFile == nil { err := trace . Errorf ( " " , sl . sid ) return 0 , trace . Wrap ( err ) } if written , err = sl . streamFile . Write ( bytes ) ; err != nil { log . Error ( err ) return written , trace . Wrap ( err ) } sl . LogEvent ( EventFields { EventType : SessionPrintEvent , SessionPrintEventBytes : len ( bytes ) } ) atomic . AddInt64 ( & sl . writtenBytes , int64 ( len ( bytes ) ) ) return written , nil }
Write takes a stream of bytes (usually the output from a session terminal)
and writes it into a "stream file", for future replay of interactive sessions.
Write takes a stream of bytes ( usually the output from a session terminal ) and writes it into a " stream file " for future replay of interactive sessions .
// log this as a session event (but not more often than once a sec) // increase the total lengh of the stream