Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
RotatingLog Class Reference

## Public Member Functions
| __init__ (self, path="./log_file", hourInterval=24, megabyteLimit=1024)
| __del__ (self)
| __next__ (self)
| close (self)
| fileno (self)
| filePath (self)
| flush (self)
| isatty (self)
| read (self, size)
| readline (self, size)
| readlines (self, sizehint)
| rotate (self)
| seek (self, offset, whence=0)
| shouldRotate (self)
| tell (self)
| truncate (self, size)
| write (self, data)
| writelines (self, sequence)
| xreadlines (self)

## Public Attributes
int | closed = self.file.closed
| file = file
| mode = self.file.mode
| name = self.file.name
| path = path
int | sizeLimit = None
| softspace = self.file.softspace
int | timeInterval = None
int | timeLimit = None

## Static Public Attributes
| next = __next__

## Detailed Description

    An `open()` replacement that will automatically open and write
    to a new file if the prior file is too large or after a time interval.

## Constructor & Destructor Documentation

## ◆ __init__()

__init__ | ( |  | self,
|  |  | path = "./log_file",
|  |  | hourInterval = 24,
|  |  | megabyteLimit = 1024 )

    Args:
        path: a full or partial path with file name.
        hourInterval: the number of hours at which to rotate the file.
        megabyteLimit: the number of megabytes of file size the log may
            grow to, after which the log is rotated.  Note: The log file
            may get a bit larger than limit do to writing out whole lines
            (last line may exceed megabyteLimit or "megabyteGuidline").

## ◆ __del__()

__del__ | ( |  | self | ) |

## Member Function Documentation

## ◆ __next__()

__next__ | ( |  | self | ) |

## ◆ close()

close | ( |  | self | ) |

## ◆ fileno()

fileno | ( |  | self | ) |

## ◆ filePath()

filePath | ( |  | self | ) |

## ◆ flush()

flush | ( |  | self | ) |

## ◆ isatty()

isatty | ( |  | self | ) |

## ◆ read()

read | ( |  | self,
|  |  | size )

## ◆ readline()

readline | ( |  | self,
|  |  | size )

## ◆ readlines()

readlines | ( |  | self,
|  |  | sizehint )

## ◆ rotate()

rotate | ( |  | self | ) |

    Rotate the log now.  You normally shouldn't need to call this.
    See write().

## ◆ seek()

seek | ( |  | self,
|  |  | offset,
|  |  | whence = 0 )

## ◆ shouldRotate()

shouldRotate | ( |  | self | ) |

    Returns a bool about whether a new log file should
    be created and written to (while at the same time
    stopping output to the old log file and closing it).

## ◆ tell()

tell | ( |  | self | ) |

## ◆ truncate()

truncate | ( |  | self,
|  |  | size )

## ◆ write()

write | ( |  | self,
|  |  | data )

    Write the data to either the current log or a new one,
    depending on the return of shouldRotate() and whether
    the new file can be opened.

## ◆ writelines()

writelines | ( |  | self,
|  |  | sequence )

## ◆ xreadlines()

xreadlines | ( |  | self | ) |

## Member Data Documentation

## ◆ closed

int closed = self.file.closed

## ◆ file

file = file

## ◆ mode

mode = self.file.mode

## ◆ name

name = self.file.name

## ◆ next

next = __next__
| static

## ◆ path

path = path

## ◆ sizeLimit

int sizeLimit = None

## ◆ softspace

softspace = self.file.softspace

## ◆ timeInterval

int timeInterval = None

## ◆ timeLimit

int timeLimit = None