39 <<
"**********************************************************" <<
newLine
86 if (c ==
'\n' || c ==
'\r')
96 tempFile.overwriteTargetFileWithTemporary();
105 return File (
"~/Library/Logs");
129 .getNonexistentSibling(),
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.
bool openedOk() const noexcept
Returns true if the stream opened without problems.
Represents a local file or directory.
int64 getSize() const
Returns the size of the file in bytes.
@ 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.
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.
bool deleteFile() const
Deletes a file.
bool exists() const
Checks whether the file actually exists.
Automatically locks and unlocks a mutex object.
virtual int64 writeFromInputStream(InputStream &source, int64 maxNumBytesToWrite)
Reads data from an input stream and writes it to this stream.
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.
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.
NewLine newLine
A predefined object representing a new-line, which can be written to a string or stream.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
long long int64
A platform-independent 64-bit integer type.