Changeset 874 for cpp/common/log.h


Ignore:
Timestamp:
05/05/19 06:21:06 (5 years ago)
Author:
Maciej Komosinski
Message:

Introduced a function logLevelName() to avoid potential errors, e.g. forgetting "+1" in LOG_LEVEL[level+1]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/log.h

    r511 r874  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2019  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    88#include <stdarg.h>
    99
    10 extern const char* LOG_LEVEL[];
     10extern const char* LOG_LEVEL_ARRAY[];
    1111#define LOG_FORMAT "%s%s.%s: %s"
    1212#define LOG_MULTILINE_CONTINUATION "..."
    13 
    1413
    1514void logPrintf(const char *obj, const char *method, int level, const char *msgf, ...);
     
    1716void log_printf(const char *msgf, ...); //a shorthand for printf (a different name again to avoid the risk of confusion with the two functions above. This would be unlikely but possible when the argument types would match)
    1817void logMessage(const char *obj, const char *method, int level, const char *msg);
     18const char* logLevelName(int level);
    1919
    2020
Note: See TracChangeset for help on using the changeset viewer.