Documentation ¶
Index ¶
- Constants
- Variables
- func CheckName(name string) error
- func ExtractName(name string) string
- func GetDir(name string, subDir string) (string, error)
- func GetLogFilePaths(name string, subDir string) (string, string, error)
- func ProcName(name string, username string) (string, error)
- func SetLogFile(name string, uid int, subDir string) (*os.File, *os.File, error)
- type File
- type LogFormatter
- type Logger
Constants ¶
View Source
const ( // SingSubDir represents directory where Singularity instance files are stored SingSubDir = "sing" // LogSubDir represents directory where Singularity instance log files are stored LogSubDir = "logs" )
View Source
const ( // BasicLogFormat represents basic log format. BasicLogFormat = "basic" // KubernetesLogFormat represents kubernetes log format. KubernetesLogFormat = "kubernetes" // JSONLogFormat represents JSON log format. JSONLogFormat = "json" )
View Source
const (
// ProgPrefix is the prefix used by a singularity instance process
ProgPrefix = "Singularity instance"
)
Variables ¶
View Source
var LogFormats = map[string]LogFormatter{ BasicLogFormat: basicLogFormatter, KubernetesLogFormat: kubernetesLogFormatter, JSONLogFormat: jsonLogFormatter, }
LogFormats contains supported log format by default.
Functions ¶
func ExtractName ¶
ExtractName extracts instance name from an instance:// URI
func GetLogFilePaths ¶
GetLogFilePaths returns the paths of log files containing .err, .out streams, respectively
Types ¶
type File ¶
type File struct { Path string `json:"-"` Pid int `json:"pid"` PPid int `json:"ppid"` Name string `json:"name"` User string `json:"user"` Image string `json:"image"` Config []byte `json:"config"` UserNs bool `json:"userns"` Cgroup bool `json:"cgroup"` IP string `json:"ip"` LogErrPath string `json:"logErrPath"` LogOutPath string `json:"logOutPath"` }
File represents an instance file storing instance information
type LogFormatter ¶
LogFormatter implements a log formatter.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger defines a file logger.
func NewLogger ¶
func NewLogger(logPath string, formatter LogFormatter) (*Logger, error)
NewLogger instantiates a new logger with formatter and return it.
func (*Logger) Close ¶
func (l *Logger) Close()
Close closes all pipe pairs created with NewWriter and also closes log file descriptor.
func (*Logger) ReOpenFile ¶
ReOpenFile closes and re-open log file (eg: log rotation).
Click to show internal directories.
Click to hide internal directories.