@@ -42,6 +42,8 @@ type GolangLog struct {
4242 Level string `json:"level"`
4343 MSG string `json:"msg"`
4444 Time string `json:"time"`
45+
46+ isFramed bool
4547}
4648
4749func (g GolangLog ) newRandomMessage () string {
@@ -65,7 +67,7 @@ func (g GolangLog) newRandomMessage() string {
6567 return msgList [g .Level ]
6668}
6769
68- func NewGolangLogRandom (i GolangLogIntensity ) GolangLog {
70+ func NewGolangLogRandom (i GolangLogIntensity ) * GolangLog {
6971 rand .Seed (time .Now ().UTC ().UnixNano ())
7072 c , err := wr .NewChooser (
7173 wr.Choice {Item : "error" , Weight : * i .ErrorWeight },
@@ -76,7 +78,7 @@ func NewGolangLogRandom(i GolangLogIntensity) GolangLog {
7678 if err != nil {
7779 log .Error (err )
7880 }
79- return GolangLog {
81+ return & GolangLog {
8082 Application : randomdata .StringSample ("webshop" , "blog" ),
8183 Environment : randomdata .StringSample ("production" , "sandbox" , "demo" ),
8284 Component : randomdata .StringSample ("frontend" , "backend" , "worker" ),
@@ -104,6 +106,14 @@ func (g GolangLog) String() (string, float64) {
104106 return message , float64 (len ([]byte (message )))
105107}
106108
109+ func (l * GolangLog ) IsFramed () bool {
110+ return l .isFramed
111+ }
112+
113+ func (l * GolangLog ) SetFramed (f bool ) {
114+ l .isFramed = f
115+ }
116+
107117func (g GolangLog ) Labels () prometheus.Labels {
108118 return prometheus.Labels {
109119 "type" : "golang" ,
0 commit comments