lfdominguez/docker_log_driver_loki

View on GitHub

Showing 3 of 3 total issues

Function logMessageToLoki has 67 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func logMessageToLoki(lp *logPair, message []byte) error {
    stackStrSize := len(lp.logLine.StackName)

    // Convert to Runes to avoid problems with multibytes (Unicode, UTF-8, UTF-16, etc) characters.
    runes := []rune(lp.logLine.ServiceName)
Severity: Minor
Found in driver/writer.go - About 1 hr to fix

    Method Driver.StartLogging has 7 return statements (exceeds 4 allowed).
    Open

    func (d *Driver) StartLogging(file string, logCtx logger.Info) error {
        d.mu.Lock()
        if _, exists := d.logs[path.Base(file)]; exists {
            d.mu.Unlock()
            return fmt.Errorf("logger for %q already exists", file)
    Severity: Major
    Found in driver/driver.go - About 45 mins to fix

      Function handlers has 5 return statements (exceeds 4 allowed).
      Open

      func handlers(h *sdk.Handler, d *driver.Driver) {
          h.HandleFunc("/LogDriver.StartLogging", func(w http.ResponseWriter, r *http.Request) {
              var req StartLoggingRequest
              if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
                  http.Error(w, err.Error(), http.StatusBadRequest)
      Severity: Major
      Found in http.go - About 35 mins to fix
        Severity
        Category
        Status
        Source
        Language