lock sync.Locker // Synchronizes editing and writing
params LoggerParams // Parameters we were given
+ // TODO(misha): replace lastWrite with nextWriteAllowed
lastWrite time.Time // The last time we wrote a log entry
modified bool // Has this data been modified since the last write
if arvLogger != nil {
arvLogger.MutateLog(func(properties map[string]interface{},
entry map[string]interface{}) {
- runInfo := make(map[string]interface{})
- runInfo["start_time"] = time.Now()
- runInfo["args"] = os.Args
- hostname, err := os.Hostname()
- if err != nil {
- runInfo["hostname_error"] = err.Error()
- } else {
- runInfo["hostname"] = hostname
- }
- runInfo["pid"] = os.Getpid()
- properties["run_info"] = runInfo
- })
+ runInfo := make(map[string]interface{})
+ runInfo["start_time"] = time.Now()
+ runInfo["args"] = os.Args
+ hostname, err := os.Hostname()
+ if err != nil {
+ runInfo["hostname_error"] = err.Error()
+ } else {
+ runInfo["hostname"] = hostname
+ }
+ runInfo["pid"] = os.Getpid()
+ properties["run_info"] = runInfo
+ })
arvLogger.Edit()
arvLogger.AddWriteHook(LogMemoryAlloc)