Panda3D
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
RotatingLog Class Reference

Public Member Functions

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

Public Attributes

 closed
 
 file
 
 mode
 
 name
 
 path
 
 sizeLimit
 
 softspace
 
 timeInterval
 
 timeLimit
 

Static Public Attributes

def next = __next__
 

Detailed Description

A file() (or 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__()

def __init__ (   self,
  path = "./log_file",
  hourInterval = 24,
  megabyteLimit = 1024 
)
path is a full or partial path with file name.
hourInterval is the number of hours at which to rotate the file.
megabyteLimit is 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__()

def __del__ (   self)

Member Function Documentation

◆ __next__()

def __next__ (   self)

◆ close()

def close (   self)

◆ fileno()

def fileno (   self)

◆ filePath()

def filePath (   self)

◆ flush()

def flush (   self)

◆ isatty()

def isatty (   self)

◆ read()

def read (   self,
  size 
)

◆ readline()

def readline (   self,
  size 
)

◆ readlines()

def readlines (   self,
  sizehint 
)

◆ rotate()

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

◆ seek()

def seek (   self,
  offset,
  whence = 0 
)

◆ shouldRotate()

def 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()

def tell (   self)

◆ truncate()

def truncate (   self,
  size 
)

◆ write()

def 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()

def writelines (   self,
  sequence 
)

◆ xreadlines()

def xreadlines (   self)

Member Data Documentation

◆ closed

closed

◆ file

file

◆ mode

mode

◆ name

name

◆ next

def next = __next__
static

◆ path

path

◆ sizeLimit

sizeLimit

◆ softspace

softspace

◆ timeInterval

timeInterval

◆ timeLimit

timeLimit