Loading...
Searching...
No Matches
juce_FileLogger.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API FileLogger : public Logger
{
public:
//==============================================================================
FileLogger (const File& fileToWriteTo,
const String& welcomeMessage,
const int64 maxInitialFileSizeBytes = 128 * 1024);
~FileLogger() override;
//==============================================================================
const File& getLogFile() const noexcept { return logFile; }
//==============================================================================
static FileLogger* createDefaultAppLogger (const String& logFileSubDirectoryName,
const String& logFileName,
const String& welcomeMessage,
const int64 maxInitialFileSizeBytes = 128 * 1024);
static FileLogger* createDateStampedLogger (const String& logFileSubDirectoryName,
const String& logFileNameRoot,
const String& logFileNameSuffix,
const String& welcomeMessage);
//==============================================================================
static File getSystemLogFileFolder();
// (implementation of the Logger virtual method)
void logMessage (const String&) override;
//==============================================================================
static void trimFileSize (const File& file, int64 maxFileSize);
private:
//==============================================================================
File logFile;
CriticalSection logLock;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FileLogger)
};
} // namespace juce
juce::CriticalSection
Definition juce_CriticalSection.h:43
juce::FileLogger
Definition juce_FileLogger.h:35
juce::FileLogger::FileLogger
FileLogger(const File &fileToWriteTo, const String &welcomeMessage, const int64 maxInitialFileSizeBytes=128 *1024)
Definition juce_FileLogger.cpp:26
juce::FileLogger::getLogFile
const File & getLogFile() const noexcept
Definition juce_FileLogger.h:63
juce::File
Definition juce_File.h:45
juce::String
Definition juce_String.h:53