l.lock.Unlock()
}
+// Similar to Record, but forces a write without respecting the
+// MinimumWriteInterval. This is useful if you know that you're about
+// to quit (e.g. if you discovered a fatal error).
+func (l *Logger) ForceRecord() {
+ l.write()
+ l.lock.Unlock()
+}
// Whether enough time has elapsed since the last write.
func (l *Logger) writeAllowedNow() bool {
flag.StringVar(&heap_profile_filename,
"heap-profile",
"",
- "File to write the heap profiles to.")
+ "File to write the heap profiles to. Leave blank to skip profiling.")
}
// // Methods to implement util.SdkListResponse Interface
var collections SdkCollectionList
err := params.Client.List("collections", sdkParams, &collections)
if err != nil {
+ if params.Logger != nil {
+ properties,_ := params.Logger.Edit()
+ properties["FATAL"] = err.Error()
+ params.Logger.Record()
+ }
log.Fatalf("error querying collections: %+v", err)
}