mirror of
https://github.com/documize/community.git
synced 2025-07-24 07:39:43 +02:00
bug fixes galore
This commit is contained in:
parent
62b7b149c1
commit
557da2847e
13 changed files with 148 additions and 67 deletions
|
@ -13,8 +13,11 @@
|
|||
package logging
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
"github.com/documize/community/core/env"
|
||||
"github.com/jmoiron/sqlx"
|
||||
|
@ -35,6 +38,14 @@ func (l Logger) Info(message string) {
|
|||
func (l Logger) Error(message string, err error) {
|
||||
l.log.Println(message)
|
||||
l.log.Println(err)
|
||||
|
||||
stack := make([]byte, 4096)
|
||||
runtime.Stack(stack, false)
|
||||
if idx := bytes.IndexByte(stack, 0); idx > 0 && idx < len(stack) {
|
||||
stack = stack[:idx] // remove trailing nulls from stack dump
|
||||
}
|
||||
|
||||
l.log.Println(fmt.Sprintf("%s", stack))
|
||||
}
|
||||
|
||||
// SetDB associates database connection with given logger.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue