Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for IsJSON (0.15 sec)

  1. internal/logger/target/console/console.go

    }
    
    // Send log message 'e' to console
    func (c *Target) Send(e interface{}) error {
    	entry, ok := e.(log.Entry)
    	if !ok {
    		return fmt.Errorf("Uexpected log entry structure %#v", e)
    	}
    	if logger.IsJSON() {
    		logJSON, err := json.Marshal(&entry)
    		if err != nil {
    			return err
    		}
    		fmt.Fprintln(c.output, string(logJSON))
    		return nil
    	}
    
    	if entry.Level == logger.EventKind {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed May 01 17:57:52 GMT 2024
    - 3.9K bytes
    - Viewed (0)
  2. internal/logger/logger.go

    	jsonFlag = true
    	quietFlag = true
    }
    
    // EnableAnonymous - turns anonymous flag
    // to avoid printing sensitive information.
    func EnableAnonymous() {
    	anonFlag = true
    }
    
    // IsJSON - returns true if jsonFlag is true
    func IsJSON() bool {
    	return jsonFlag
    }
    
    // IsQuiet - returns true if quietFlag is true
    func IsQuiet() bool {
    	return quietFlag
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sat May 04 00:17:57 GMT 2024
    - 12.4K bytes
    - Viewed (0)
Back to top