Fray Engine
Loading...
Searching...
No Matches
fray::log::ProjectScope Class Reference

Temporarily tag log lines on the calling thread, then restore its previous tag. Construct and destroy the scope on the same thread. More...

#include <log_manager.hpp>

Public Member Functions

 ProjectScope (const std::string &project)
 Save the calling thread's tag and optionally replace it.
 ProjectScope (const ProjectScope &)=delete
 Disallow copying a project tag scope.
ProjectScope & operator= (const ProjectScope &)=delete
 Disallow copy assignment of a project tag scope.
 ~ProjectScope ()
 Restore the saved tag on the calling thread.

Private Attributes

std::string _previous
 Project tag to restore when this scope ends.

Detailed Description

Temporarily tag log lines on the calling thread, then restore its previous tag. Construct and destroy the scope on the same thread.

Definition at line 293 of file log_manager.hpp.

Constructor & Destructor Documentation

◆ ProjectScope() [1/2]

fray::log::ProjectScope::ProjectScope ( const std::string & project)
inlineexplicit

Save the calling thread's tag and optionally replace it.

Parameters
projectNew project tag; empty leaves the current tag unchanged.

Definition at line 306 of file log_manager.hpp.

◆ ProjectScope() [2/2]

fray::log::ProjectScope::ProjectScope ( const ProjectScope & )
delete

Disallow copying a project tag scope.

◆ ~ProjectScope()

fray::log::ProjectScope::~ProjectScope ( )
inline

Restore the saved tag on the calling thread.

Definition at line 327 of file log_manager.hpp.

Member Function Documentation

◆ operator=()

ProjectScope & fray::log::ProjectScope::operator= ( const ProjectScope & )
delete

Disallow copy assignment of a project tag scope.

Member Data Documentation

◆ _previous

std::string fray::log::ProjectScope::_previous
private

Project tag to restore when this scope ends.

Definition at line 299 of file log_manager.hpp.


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