|
|
|
|
@ -57,7 +57,7 @@ type (
|
|
|
|
|
|
|
|
|
|
func NewFmtText(options ...FmtTextFnc) *FmtText {
|
|
|
|
|
fm := applyFmtTextOptions(&FmtText{
|
|
|
|
|
FmtTextAtt: FmtTextAttIndent | FmtTextAttVerbose | FmtTextAttTrace | FmtTextAttColors,
|
|
|
|
|
FmtTextAtt: FmtTextAttIndent | FmtTextAttVerbose | FmtTextAttTrace | FmtTextAttColors | FmtTextAttEmpty,
|
|
|
|
|
dateLayout: time.RFC822Z,
|
|
|
|
|
indent : " ",
|
|
|
|
|
fixName : 12,
|
|
|
|
|
@ -110,7 +110,7 @@ func (f *FmtText) Format (err error) []byte {
|
|
|
|
|
|
|
|
|
|
func (f *FmtText) formatAll (s *FmtTextState, err error) {
|
|
|
|
|
|
|
|
|
|
s.WriteFieldString("error",err.Error())
|
|
|
|
|
s.WriteFieldString("error",err.Error(),FmtTextColorRed)
|
|
|
|
|
s.WriteFieldString("error-type",reflect.TypeOf(err).String())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -243,12 +243,13 @@ func formatStackTrace(s *FmtTextState, t StackTrace) {
|
|
|
|
|
if sc,er := f.SourceLine(); er == nil {
|
|
|
|
|
|
|
|
|
|
if len(sc) > 80 {
|
|
|
|
|
ls := typex.SplitString(sc,80)
|
|
|
|
|
ls := typex.SplitString(sc,70)
|
|
|
|
|
for _,l := range ls {
|
|
|
|
|
FmtTextColorMagenta.BeginString()
|
|
|
|
|
s.Buffer.WriteString(FmtTextColorMagenta.BeginString())
|
|
|
|
|
s.Buffer.WriteString(" ")
|
|
|
|
|
s.Buffer.WriteString(l)
|
|
|
|
|
s.Buffer.WriteByte('\n')
|
|
|
|
|
FmtTextColorMagenta.EndString()
|
|
|
|
|
s.Buffer.WriteString(FmtTextColorMagenta.EndString())
|
|
|
|
|
}
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|