Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for FileNameFunc (0.1 sec)

  1. internal/logger/logrotate.go

    	MaximumFileSize int64
    
    	// FileNameFunc specifies the name a new file will take.
    	// FileNameFunc must ensure collisions in filenames do not occur.
    	// Do not rely on timestamps to be unique, high throughput writes
    	// may fall on the same timestamp.
    	// Eg.
    	// 	2020-03-28_15-00-945-<random-hash>.log
    	// When FileNameFunc is not specified, DefaultFilenameFunc will be used.
    	FileNameFunc func() string
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  2. cmd/server-main.go

    	if lgDir == "" {
    		return os.Stderr, nil
    	}
    	lgDirAbs, err := filepath.Abs(lgDir)
    	if err != nil {
    		return nil, err
    	}
    	lgSize := ctx.Int("log-size")
    
    	var fileNameFunc func() string
    	if ctx.IsSet("log-prefix") {
    		fileNameFunc = func() string {
    			return fmt.Sprintf("%s-%s.log", ctx.String("log-prefix"), fmt.Sprintf("%X", time.Now().UTC().UnixNano()))
    		}
    	}
    
    	output, err := logger.NewDir(logger.Options{
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Jun 04 15:12:57 UTC 2024
    - 34.5K bytes
    - Viewed (1)
Back to top