USBGuard
Software framework that protects your computer against rogue USB devices by implementing basic whitelisting and blacklisting capabilities.
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
usbguard::LogStream Class Reference

Log stream. More...

#include <Logger.hpp>

Inheritance diagram for usbguard::LogStream:

Classes

struct  Source
 Contains information about the source. More...
 

Public Types

enum  Level : int {
  Audit = -2, Error = -1, Warning = 0, Info = 1,
  Debug = 2, Trace = 3
}
 Log levels.
 

Public Member Functions

 LogStream (Logger &logger, const Source &source, Level level)
 Constructs new LogStream with given logger, source and Level level. More...
 
 LogStream (const LogStream &rhs)
 Constructs copy of LogStream rhs. More...
 
 ~LogStream ()
 Writes into a log before destruction.
 

Static Public Member Functions

static const std::string sourceToString (const Source &source)
 Returns string representation of given source. More...
 
static const std::string levelToString (Level level)
 Returns string representation of given level. More...
 

Detailed Description

Log stream.

Constructor & Destructor Documentation

◆ LogStream() [1/2]

usbguard::LogStream::LogStream ( Logger logger,
const Source source,
Level  level 
)

Constructs new LogStream with given logger, source and Level level.

Parameters
loggerLogger.
sourceSource.
levelLog level.

◆ LogStream() [2/2]

usbguard::LogStream::LogStream ( const LogStream rhs)

Constructs copy of LogStream rhs.

Parameters
rhsLogStream to copy.

Member Function Documentation

◆ levelToString()

const std::string usbguard::LogStream::levelToString ( Level  level)
static

Returns string representation of given level.

Example: levelToString(Audit) = (A)

Parameters
levelLogger level to transform into string.
Returns
String representation of given level.
Exceptions
runtime_errorIf level is invalid.
See also
level

◆ sourceToString()

const std::string usbguard::LogStream::sourceToString ( const Source source)
static

Returns string representation of given source.

Format: <file>@<line>/<function>

Parameters
sourceSource to transform into string.
Returns
String representation of given source.
See also
Source

The documentation for this class was generated from the following files: