func (c *GCLClient) Context() context.Context {
	return c.ctx
}
Context returns context instance this client was initialized with
as it may survive local function context which is i.e. cancelled or timed out
package xlog
import (
	"context"
	"encoding/json"
	"fmt"
	"net/http"
	"regexp"
	"runtime"
	"github.com/gravitational/trace"
	cl "cloud.google.com/go/logging"
	"github.com/sirupsen/logrus"
	"golang.org/x/oauth2/google"
)
const (
	maxStack = 10
)
var levelMap map[logrus.Level]cl.Severity = map[logrus.Level]cl.Severity{
	logrus.PanicLevel: cl.Emergency,
	logrus.FatalLevel: cl.Critical,
	logrus.ErrorLevel: cl.Error,
	logrus.WarnLevel:  cl.Warning,
	logrus.InfoLevel:  cl.Info,
	logrus.DebugLevel: cl.Debug,
}
type GCLClient struct {
	shortenerClient *http.Client
	gclClient       *cl.Client
	ctx             context.Context
}
func (client *GCLClient) Close() {
	client.gclClient.Close()
}
type GCLHook struct {
	log          *cl.Logger
	commonFields logrus.Fields
}
func NewGCLClient(ctx context.Context, projectID string) (client *GCLClient, err error) {
	if projectID == "" {
		return nil, trace.Errorf("no cloud logging project ID provided")
	}
	client = &GCLClient{ctx: ctx}
	client.shortenerClient, err = google.DefaultClient(ctx, urlShortenerScope)
	if err != nil {
		return nil, trace.Wrap(err, "Google OAuth failed")
	}
	client.gclClient, err = cl.NewClient(ctx, projectID)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	err = client.gclClient.Ping(ctx)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	return client, nil
}