OpenShot Library | libopenshot-audio
0.2.0
|
27 const String& welcomeMessage,
28 const int64 maxInitialFileSizeBytes)
31 if (maxInitialFileSizeBytes >= 0)
39 <<
"**********************************************************" << newLine
40 << welcomeMessage << newLine
54 out << message << newLine;
59 if (maxFileSizeBytes <= 0)
65 const int64 fileSize = file.
getSize();
67 if (fileSize > maxFileSizeBytes)
86 if (c ==
'\n' || c ==
'\r')
105 return File (
"~/Library/Logs");
112 const String& logFileName,
113 const String& welcomeMessage,
114 const int64 maxInitialFileSizeBytes)
117 .getChildFile (logFileName),
118 welcomeMessage, maxInitialFileSizeBytes);
122 const String& logFileNameRoot,
123 const String& logFileNameSuffix,
124 const String& welcomeMessage)
128 .withFileExtension (logFileNameSuffix)
129 .getNonexistentSibling(),
virtual int64 writeFromInputStream(InputStream &source, int64 maxNumBytesToWrite)
Reads data from an input stream and writes it to this stream.
String toString(bool includeDate, bool includeTime, bool includeSeconds=true, bool use24HourClock=false) const
Returns a string version of this date and time, using this machine's local timezone.
Manages a temporary file, which will be deleted when this object is deleted.
static File JUCE_CALLTYPE getSpecialLocation(const SpecialLocationType type)
Finds the location of a special type of file or directory, such as a home folder or documents folder.
static Time JUCE_CALLTYPE getCurrentTime() noexcept
Returns a Time object that is set to the current system time.
Result create() const
Creates an empty file if it doesn't already exist.
static File getSystemLogFileFolder()
Returns an OS-specific folder where log-files should be stored.
static FileLogger * createDefaultAppLogger(const String &logFileSubDirectoryName, const String &logFileName, const String &welcomeMessage, const int64 maxInitialFileSizeBytes=128 *1024)
Helper function to create a log file in the correct place for this platform.
bool openedOk() const noexcept
Returns true if the stream opened without problems.
Represents a local file or directory.
bool deleteFile() const
Deletes a file.
~FileLogger() override
Destructor.
bool exists() const
Checks whether the file actually exists.
static FileLogger * createDateStampedLogger(const String &logFileSubDirectoryName, const String &logFileNameRoot, const String &logFileNameSuffix, const String &welcomeMessage)
Helper function to create a log file in the correct place for this platform.
Automatically locks and unlocks a mutex object.
static void trimFileSize(const File &file, int64 maxFileSize)
This is a utility function which removes lines from the start of a text file to make sure that its to...
@ userApplicationDataDirectory
The folder in which applications store their persistent user-specific settings.
void logMessage(const String &) override
This is overloaded by subclasses to implement custom logging behaviour.
A simple implementation of a Logger that writes to a file.
bool overwriteTargetFileWithTemporary() const
Tries to move the temporary file to overwrite the target file that was specified in the constructor.
const File & getFile() const noexcept
Returns the temporary file.
FileLogger(const File &fileToWriteTo, const String &welcomeMessage, const int64 maxInitialFileSizeBytes=128 *1024)
Creates a FileLogger for a given file.
An output stream that writes into a local file.
int64 getSize() const
Returns the size of the file in bytes.