39 <<
"**********************************************************" << newLine
54 out << message << newLine;
75 if (! (
out.openedOk() &&
in.openedOk()))
82 const char c =
in.readByte();
86 if (
c ==
'\n' ||
c ==
'\r')
93 out.writeFromInputStream (
in, -1);
96 tempFile.overwriteTargetFileWithTemporary();
105 return File (
"~/Library/Logs");
129 .getNonexistentSibling(),
Holds a resizable array of primitive or copy-by-value objects.
A simple implementation of a Logger that writes to a file.
FileLogger(const File &fileToWriteTo, const String &welcomeMessage, const int64 maxInitialFileSizeBytes=128 *1024)
Creates a FileLogger for a given file.
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.
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...
static File getSystemLogFileFolder()
Returns an OS-specific folder where log-files should be stored.
~FileLogger() override
Destructor.
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.
void logMessage(const String &) override
This is overloaded by subclasses to implement custom logging behaviour.
An output stream that writes into a local file.
Represents a local file or directory.
int64 getSize() const
Returns the size of the file in bytes.
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.
@ userApplicationDataDirectory
The folder in which applications store their persistent user-specific settings.
Result create() const
Creates an empty file if it doesn't already exist.
bool deleteFile() const
Deletes a file.
bool exists() const
Checks whether the file actually exists.
Manages a temporary file, which will be deleted when this object is deleted.
static Time JUCE_CALLTYPE getCurrentTime() noexcept
Returns a Time object that is set to the current system time.