mirror of https://github.com/BOINC/boinc.git
LIB: introduce new warning message level
This is to be used for non critical, non normal messages that don't break anything but need to be investigated by project admins. Needed in the file_upload_handler to find hosts that reupload result files and investigate the reason.
This commit is contained in:
parent
bff1cafe50
commit
a09576fbdc
|
@ -24,6 +24,7 @@ SCHED_MSG_LOG log_messages;
|
||||||
const char* SCHED_MSG_LOG::v_format_kind(int kind) const {
|
const char* SCHED_MSG_LOG::v_format_kind(int kind) const {
|
||||||
switch(kind) {
|
switch(kind) {
|
||||||
case MSG_CRITICAL: return "[CRITICAL]";
|
case MSG_CRITICAL: return "[CRITICAL]";
|
||||||
|
case MSG_WARNING: return "[warning]";
|
||||||
case MSG_NORMAL: return "";
|
case MSG_NORMAL: return "";
|
||||||
case MSG_DEBUG: return "[debug]";
|
case MSG_DEBUG: return "[debug]";
|
||||||
default: return "*** internal error: invalid MessageKind ***";
|
default: return "*** internal error: invalid MessageKind ***";
|
||||||
|
|
|
@ -24,14 +24,14 @@
|
||||||
#include "boinc_fcgi.h"
|
#include "boinc_fcgi.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum { MSG_CRITICAL=1, MSG_NORMAL, MSG_DEBUG };
|
enum { MSG_CRITICAL=1, MSG_WARNING, MSG_NORMAL, MSG_DEBUG };
|
||||||
|
|
||||||
class SCHED_MSG_LOG : public MSG_LOG {
|
class SCHED_MSG_LOG : public MSG_LOG {
|
||||||
const char* v_format_kind(int kind) const;
|
const char* v_format_kind(int kind) const;
|
||||||
bool v_message_wanted(int kind) const;
|
bool v_message_wanted(int kind) const;
|
||||||
public:
|
public:
|
||||||
int debug_level;
|
int debug_level;
|
||||||
enum { MSG_CRITICAL=1, MSG_NORMAL, MSG_DEBUG };
|
enum { MSG_CRITICAL=1, MSG_WARNING, MSG_NORMAL, MSG_DEBUG };
|
||||||
SCHED_MSG_LOG(): MSG_LOG(stderr) { debug_level = MSG_NORMAL; }
|
SCHED_MSG_LOG(): MSG_LOG(stderr) { debug_level = MSG_NORMAL; }
|
||||||
void set_debug_level(int new_level) { debug_level = new_level; }
|
void set_debug_level(int new_level) { debug_level = new_level; }
|
||||||
void set_indent_level(const int new_indent_level);
|
void set_indent_level(const int new_indent_level);
|
||||||
|
|
|
@ -164,7 +164,7 @@ int copy_socket_to_file(FILE* in, char* path, double offset, double nbytes) {
|
||||||
// and made read-only;
|
// and made read-only;
|
||||||
// return success to the client won't keep trying
|
// return success to the client won't keep trying
|
||||||
//
|
//
|
||||||
log_messages.printf(MSG_CRITICAL,
|
log_messages.printf(MSG_WARNING,
|
||||||
"client tried to reupload the read-only file %s\n",
|
"client tried to reupload the read-only file %s\n",
|
||||||
path
|
path
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue