Documentation ¶
Index ¶
- type Worker
- func (w *Worker) PushMessage(level int8, hash uint64, msg string, pcs []uintptr)
- func (w *Worker) SetCaption(caption string)
- func (w *Worker) SetPeriod(periodSec uint)
- func (w *Worker) SetTargetChat(apiToken string, id int64)
- func (w *Worker) SetTimeZone(name string, offsetSec int)
- func (w *Worker) Stop()
- func (w *Worker) Uncork()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func Start ¶
func Start( ctx context.Context, srcRoot string, intro func(int8, int) string, errorHandler func(string), ) *Worker
Start worker.
srcRoot is a common part of the sources path being printed in a call stack (to exclude external calls and to truncate long paths).
intro arg is a callback to print an intro with prefered design.
errorHandler allows to log golog2tgm internal errors with a logger being used by a caller.
func (*Worker) PushMessage ¶
Push message to the engine.
hash allows to identify a sample externally, e.g. via program counter. Pass 0 to match samples by golog2tgm.
pcs allows to add call stack to the sample.
func (*Worker) SetCaption ¶
Set teleram message caption (e.g. your daemon name)
func (*Worker) SetTargetChat ¶
func (*Worker) SetTimeZone ¶
Set convenient time zone and its UTC offset in seconds
Click to show internal directories.
Click to hide internal directories.