Skip to content

Commit

Permalink
Make logger API actually return messages
Browse files Browse the repository at this point in the history
  • Loading branch information
SaladDais committed Oct 23, 2022
1 parent 7ce5ba6 commit 4eb8981
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libtailslide/logger.hh
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,15 @@ class Logger {
explicit Logger(ScriptAllocator *allocator) :
_mErrors(0), _mWarnings(0), _mShowEnd(false), _mShowInfo(false), _mSort(true),
_mShowErrorCodes(true), _mCheckAssertions(false),
_mFinalized(false), _mLastMessage(NULL), _mAllocator(allocator) {};
_mFinalized(false), _mAllocator(allocator) {};
void log(LogLevel type, YYLTYPE *loc, const char *fmt, ...);
void logv(LogLevel type, YYLTYPE *loc, const char *fmt, va_list args, int error=0);
void error( YYLTYPE *loc, int error, ... );
void printReport();
void reset();
void finalize();

const std::vector<class LogMessage*> & getMessages() const { return _mMessages; };
int getErrors() const { return _mErrors; }
int getWarnings() { finalize(); return _mWarnings; }
void setShowEnd(bool v) { _mShowEnd = v; }
Expand All @@ -132,13 +133,11 @@ class Logger {
bool _mShowErrorCodes;
bool _mCheckAssertions;
bool _mFinalized;
class LogMessage *_mLastMessage;
ScriptAllocator *_mAllocator;

private:
std::vector<class LogMessage*> _mMessages;
std::vector<ErrorCode> _mErrorsSeen;
std::vector< std::pair<int, ErrorCode>> _mAssertions;
std::vector<std::pair<int, ErrorCode>> _mAssertions;
static const char *_sErrorMessages[];
static const char *_sWarningMessages[];
};
Expand Down

0 comments on commit 4eb8981

Please sign in to comment.