-
Notifications
You must be signed in to change notification settings - Fork 13
/
processlogging.go
40 lines (33 loc) · 1.33 KB
/
processlogging.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package supervisord
type (
// A LogSegment represents a "tail" of a log
LogSegment struct {
Payload string `xmlrpc:"string"`
Offset int `xmlrpc:"offset"`
Overflow bool `xmlrpc:"overflow"`
}
)
// Read length bytes from name’s stdout log starting at offset.
func (c *Client) ReadProcessStdoutLog(name string, offset int, length int) (string, error) {
return c.stringCall("supervisor.readProcessStdoutLog", name, offset, length)
}
// Read length bytes from name’s stderr log starting at offset.
func (c *Client) ReadProcessStderrLog(name string, offset int, length int) (string, error) {
return c.stringCall("supervisor.readProcessStderrLog", name, offset, length)
}
// This is not implemented yet.
func (c *Client) TailProcessStdoutLog(name string, offset int, length int) ([]LogSegment, error) {
return nil, FIXMENotImplementedError
}
// This is not implemented yet.
func (c *Client) TailProcessStderrLog(name string, offset int, length int) ([]LogSegment, error) {
return nil, FIXMENotImplementedError
}
// Clear the stdout and stderr logs for the process name and reopen them.
func (c *Client) ClearProcessLogs(name string) error {
return c.boolCall("supervisor.clearProcessLogs", name)
}
// Clear all process log files.
func (c *Client) ClearAllProcessLogs() error {
return c.boolCall("supervisor.clearAllProcessLogs")
}