LoggerFile will write log messages to a specified file.

LoggerFile will write to a specified file, either appending to or overwriting that file at application startup.

space from the docs in code

LoggerFile( const fs::path &filePath = fs::path(), bool appendToExisting = true );

  • filePath defines the target logfile. For example, /tmp/cinder.log. If this parameter is left blank, LoggerFile will target a file named cinder.log that will sit next to the application binary.
  • appendToExisting configures file appending. This parameter defaults to true.




Public Member Functions

  • ~LoggerFile ()
  • void
    write (const Metadata &meta, const std::string &text) override
  • void
    setTimestampEnabled (bool enable=true)
  • bool
    isTimestampEnabled () const
  • void
    setLevel (Level level)
  • getLevel () const

Protected Member Functions

  • fs::path
    getDefaultLogFilePath () const
  • void
    ensureDirectoryExists ()
  • void
    writeDefault (std::ostream &stream, const Metadata &meta, const std::string &text)

Protected Attributes

  • fs::path
    mFilePath
  • bool
    mAppend
  • std::ofstream
    mStream
  • mLevel