32#ifndef RCSC_PLAYER_LOGGER_H
33#define RCSC_PLAYER_LOGGER_H
56 static const std::int32_t
LEVEL_00 = 0x00000000;
57 static const std::int32_t
LEVEL_01 = 0x00000001;
58 static const std::int32_t
LEVEL_02 = 0x00000002;
59 static const std::int32_t
LEVEL_03 = 0x00000004;
60 static const std::int32_t
LEVEL_04 = 0x00000008;
61 static const std::int32_t
LEVEL_05 = 0x00000010;
62 static const std::int32_t
LEVEL_06 = 0x00000020;
63 static const std::int32_t
LEVEL_07 = 0x00000040;
64 static const std::int32_t
LEVEL_08 = 0x00000080;
65 static const std::int32_t
LEVEL_09 = 0x00000100;
66 static const std::int32_t
LEVEL_10 = 0x00000200;
67 static const std::int32_t
LEVEL_11 = 0x00000400;
68 static const std::int32_t
LEVEL_12 = 0x00000800;
69 static const std::int32_t
LEVEL_13 = 0x00001000;
70 static const std::int32_t
LEVEL_14 = 0x00002000;
71 static const std::int32_t
LEVEL_15 = 0x00004000;
72 static const std::int32_t
LEVEL_16 = 0x00008000;
73 static const std::int32_t
LEVEL_17 = 0x00010000;
74 static const std::int32_t
LEVEL_18 = 0x00020000;
75 static const std::int32_t
LEVEL_19 = 0x00040000;
76 static const std::int32_t
LEVEL_20 = 0x00080000;
77 static const std::int32_t
LEVEL_21 = 0x00100000;
78 static const std::int32_t
LEVEL_22 = 0x00200000;
79 static const std::int32_t
LEVEL_23 = 0x00400000;
80 static const std::int32_t
LEVEL_24 = 0x00800000;
81 static const std::int32_t
LEVEL_25 = 0x01000000;
82 static const std::int32_t
LEVEL_26 = 0x02000000;
83 static const std::int32_t
LEVEL_27 = 0x04000000;
84 static const std::int32_t
LEVEL_28 = 0x08000000;
85 static const std::int32_t
LEVEL_29 = 0x10000000;
86 static const std::int32_t
LEVEL_30 = 0x20000000;
87 static const std::int32_t
LEVEL_31 = 0x40000000;
88 static const std::int32_t
LEVEL_32 = 0x80000000;
156 std::int32_t M_flags;
179 const std::int32_t level,
180 const bool on =
true );
188 const int end_time );
197 return ( level & M_flags );
204 void open(
const std::string & filepath );
227 return ( M_fout != NULL );
259 const char * color = NULL );
269 const char * color = NULL )
286 const int r,
const int g,
const int b );
298 const int r,
const int g,
const int b )
317 const char * color = NULL );
329 const char * color = NULL )
331 addLine( level, start.
x, start.
y, end.
x, end.
y, color );
350 const int r,
const int g,
const int b );
364 const int r,
const int g,
const int b )
366 addLine( level, start.
x, start.
y, end.
x, end.
y, r, g, b );
384 const double span_angle,
385 const char * color = NULL );
400 const double span_angle,
401 const char * color = NULL )
403 addArc( level, center.
x, center.
y, radius, start_angle, span_angle, color );
423 const double span_angle,
424 const int r,
const int g,
const int b );
441 const double span_angle,
442 const int r,
const int g,
const int b )
444 addArc( level, center.
x, center.
y, radius, start_angle, span_angle, r, g, b );
460 const char * color = NULL,
461 const bool fill =
false );
474 const char * color = NULL,
475 const bool fill =
false )
477 addCircle( level, center.
x, center.
y, radius, color, fill );
489 const char * color = NULL,
490 const bool fill =
false )
510 const int r,
const int g,
const int b,
511 const bool fill =
false );
526 const int r,
const int g,
const int b,
527 const bool fill =
false )
529 addCircle( level, center.
x, center.
y, radius, r, g, b, fill );
543 const int r,
const int g,
const int b,
544 const bool fill =
false )
571 const char * color = NULL,
572 const bool fill =
false );
587 const char * color = NULL,
588 const bool fill =
false )
607 const char * color = NULL,
608 const bool fill =
false )
611 tri.
a().
x, tri.
a().
y,
612 tri.
b().
x, tri.
b().
y,
613 tri.
c().
x, tri.
c().
y,
639 const int r,
const int g,
const int b,
640 const bool fill =
false );
657 const int r,
const int g,
const int b,
658 const bool fill =
false )
679 const int r,
const int g,
const int b,
680 const bool fill =
false )
683 tri.
a().
x, tri.
a().
y,
684 tri.
b().
x, tri.
b().
y,
685 tri.
c().
x, tri.
c().
y,
705 const char * color = NULL,
706 const bool fill =
false );
717 const char * color = NULL,
718 const bool fill =
false )
744 const int r,
const int g,
const int b,
745 const bool fill =
false );
758 const int r,
const int g,
const int b,
759 const bool fill =
false )
783 const double min_radius,
784 const double max_radius,
786 const double span_angle,
787 const char * color = NULL,
788 const bool fill =
false );
803 const double min_radius,
804 const double max_radius,
806 const double span_angle,
807 const char * color = NULL,
808 const bool fill =
false )
811 center.
x, center.
y, min_radius, max_radius,
812 start_angle, span_angle,
834 const double min_radius,
835 const double max_radius,
837 const double span_angle,
838 const int r,
const int g,
const int b,
839 const bool fill =
false );
856 const double min_radius,
857 const double max_radius,
859 const double span_angle,
860 const int r,
const int g,
const int b,
861 const bool fill =
false )
864 center.
x, center.
y, min_radius, max_radius,
865 start_angle, span_angle,
879 const char * color = NULL,
880 const bool fill =
false );
893 const int r,
const int g,
const int b,
894 const bool fill =
false );
908 const char * color = NULL );
920 const char * color = NULL )
941 const int r,
const int g,
const int b );
955 const int r,
const int g,
const int b )
2D circle region Header File.
degree wrapper class
Definition: angle_deg.h:45
2d circle class
Definition: circle_2d.h:51
const Vector2D & center() const
get the center point
Definition: circle_2d.h:135
double radius() const
get the radius value
Definition: circle_2d.h:144
game time object
Definition: game_time.h:43
log output manager
Definition: logger.h:53
void addCircle(const std::int32_t level, const Vector2D ¢er, const double radius, const int r, const int g, const int b, const bool fill=false)
add circle info to buffer with cycle, level & message tag 'c'
Definition: logger.h:523
void addPoint(const std::int32_t level, const Vector2D &pos, const char *color=NULL)
add point info to buffer with cycle, level & message tag 'p'
Definition: logger.h:267
void addRect(const std::int32_t level, const double left, const double top, const double length, const double width, const int r, const int g, const int b, const bool fill=false)
add rect info to buffer with cycle, level & message tag 'r'
void addLine(const std::int32_t level, const double x1, const double y1, const double x2, const double y2, const int r, const int g, const int b)
add line info to buffer with cycle, level & message tag 'l'
static const std::int32_t POSITIONING
log level definition alias
Definition: logger.h:134
static const std::int32_t LEVEL_26
log level definition variable
Definition: logger.h:82
void addMessage(const std::int32_t level, const double x, const double y, const char *msg, const char *color=NULL)
add message info to buffer with cycle, level & message tag 'm'
static const std::int32_t WORLD
log level definition alias
Definition: logger.h:122
void addSector(const std::int32_t level, const Vector2D ¢er, const double min_radius, const double max_radius, const AngleDeg &start_angle, const double span_angle, const char *color=NULL, const bool fill=false)
add arc info to the buffer. message tag 'a'
Definition: logger.h:801
void addText(const std::int32_t level, const char *msg,...)
add free message to buffer with cycle, level & message tag 'T'
void addTriangle(const std::int32_t level, const Vector2D &p1, const Vector2D &p2, const Vector2D &p3, const int r, const int g, const int b, const bool fill=false)
add triangle info to buffer with cycle, level & message tag 't'
Definition: logger.h:653
void addSector(const std::int32_t level, const double x, const double y, const double min_radius, const double max_radius, const AngleDeg &start_angle, const double span_angle, const int r, const int g, const int b, const bool fill=false)
add arc info to the buffer. message tag 'a'
bool isOpen()
check if file is opened
Definition: logger.h:225
static const std::int32_t LEVEL_28
log level definition variable
Definition: logger.h:84
static const std::int32_t ACTION_CHAIN
log level definition alias
Definition: logger.h:140
static const std::int32_t SHOOT
log level definition alias
Definition: logger.h:130
void addArc(const std::int32_t level, const Vector2D ¢er, const double radius, const AngleDeg &start_angle, const double span_angle, const int r, const int g, const int b)
add arc info to the buffer. message tag 'a'
Definition: logger.h:437
void openStandardOutput()
use standard output to record
static const std::int32_t LEVEL_11
log level definition variable
Definition: logger.h:67
static const std::int32_t HOLD
log level definition alias
Definition: logger.h:126
void addLine(const std::int32_t level, const Vector2D &start, const Vector2D &end, const char *color=NULL)
add line info to buffer with cycle, level & message tag 'l'
Definition: logger.h:326
static const std::int32_t LEVEL_05
log level definition variable
Definition: logger.h:61
static const std::int32_t LEVEL_23
log level definition variable
Definition: logger.h:79
void addCircle(const std::int32_t level, const double x, const double y, const double radius, const int r, const int g, const int b, const bool fill=false)
add circle info to buffer with cycle, level & message tag 'c'
static const std::int32_t LEVEL_19
log level definition variable
Definition: logger.h:75
void addSector(const std::int32_t level, const Sector2D §or, const char *color=NULL, const bool fill=false)
add arc info to the buffer. message tag 'a'
static const std::int32_t CROSS
log level definition alias
Definition: logger.h:129
void addRect(const std::int32_t level, const Rect2D &rect, const char *color=NULL, const bool fill=false)
add rect info to buffer with cycle, level & message tag 'r'
Definition: logger.h:715
static const std::int32_t SYSTEM
log level definition alias
Definition: logger.h:120
void addTriangle(const std::int32_t level, const Triangle2D &tri, const char *color=NULL, const bool fill=false)
add triangle info to buffer with cycle, level & message tag 't'
Definition: logger.h:605
bool isEnabled(const std::int32_t level) const
check if the level is enabled
Definition: logger.h:195
void addMessage(const std::int32_t level, const Vector2D &pos, const char *msg, const int r, const int g, const int b)
add message info to buffer with cycle, level & message tag 'm'
Definition: logger.h:952
void addLine(const std::int32_t level, const Vector2D &start, const Vector2D &end, const int r, const int g, const int b)
add line info to buffer with cycle, level & message tag 'l'
Definition: logger.h:361
static const std::int32_t ANALYZER
log level definition alias
Definition: logger.h:138
void addCircle(const std::int32_t level, const Circle2D &circle, const char *color=NULL, const bool fill=false)
add circle info to buffer with cycle, level & message tag 'c'
Definition: logger.h:487
void addCircle(const std::int32_t level, const Circle2D &circle, const int r, const int g, const int b, const bool fill=false)
add circle info to buffer with cycle, level & message tag 'c'
Definition: logger.h:541
void addLine(const std::int32_t level, const double x1, const double y1, const double x2, const double y2, const char *color=NULL)
add line info to buffer with cycle, level & message tag 'l'
void clear()
clear buffer without flush
void setTimeRange(const int start_time, const int end_time)
set the range of the recorded game time
static const std::int32_t LEVEL_10
log level definition variable
Definition: logger.h:66
static const std::int32_t LEVEL_31
log level definition variable
Definition: logger.h:87
static const std::int32_t ACTION
log level definition alias
Definition: logger.h:123
static const std::int32_t LEVEL_24
log level definition variable
Definition: logger.h:80
static const std::int32_t LEVEL_18
log level definition variable
Definition: logger.h:74
void addSector(const std::int32_t level, const Sector2D §or, const int r, const int g, const int b, const bool fill=false)
add arc info to the buffer. message tag 'a'
void addTriangle(const std::int32_t level, const Triangle2D &tri, const int r, const int g, const int b, const bool fill=false)
add triangle info to buffer with cycle, level & message tag 't'
Definition: logger.h:677
static const std::int32_t LEVEL_06
log level definition variable
Definition: logger.h:62
static const std::int32_t COMMUNICATION
log level definition alias
Definition: logger.h:137
static const std::int32_t LEVEL_15
log level definition variable
Definition: logger.h:71
static const std::int32_t LEVEL_02
log level definition variable
Definition: logger.h:58
static const std::int32_t MARK
log level definition alias
Definition: logger.h:133
static const std::int32_t ACT_SEQ
log level definition alias
Definition: logger.h:139
void close()
close file if opened
static const std::int32_t LEVEL_07
log level definition variable
Definition: logger.h:63
~Logger()
if file is opened, flush buffer and close file.
void addTriangle(const std::int32_t level, const double x1, const double y1, const double x2, const double y2, const double x3, const double y3, const char *color=NULL, const bool fill=false)
add triangle info to buffer with cycle, level & message tag 't'
void addArc(const std::int32_t level, const double x, const double y, const double radius, const AngleDeg &start_angle, const double span_angle, const int r, const int g, const int b)
add arc info to the buffer. message tag 'a'
static const std::int32_t LEVEL_25
log level definition variable
Definition: logger.h:81
static const std::int32_t LEVEL_21
log level definition variable
Definition: logger.h:77
static const std::int32_t LEVEL_27
log level definition variable
Definition: logger.h:83
void addTriangle(const std::int32_t level, const Vector2D &p1, const Vector2D &p2, const Vector2D &p3, const char *color=NULL, const bool fill=false)
add triangle info to buffer with cycle, level & message tag 't'
Definition: logger.h:583
static const std::int32_t PASS
log level definition alias
Definition: logger.h:128
static const std::int32_t LEVEL_00
log level definition variable
Definition: logger.h:56
static const std::int32_t LEVEL_01
log level definition variable
Definition: logger.h:57
void addMessage(const std::int32_t level, const double x, const double y, const char *msg, const int r, const int g, const int b)
add message info to buffer with cycle, level & message tag 'm'
void addArc(const std::int32_t level, const double x, const double y, const double radius, const AngleDeg &start_angle, const double span_angle, const char *color=NULL)
add arc info to the buffer. message tag 'a'
void addPoint(const std::int32_t level, const double x, const double y, const char *color=NULL)
add point info to buffer with cycle, level & message tag 'p'
static const std::int32_t LEVEL_12
log level definition variable
Definition: logger.h:68
void addMessage(const std::int32_t level, const Vector2D &pos, const char *msg, const char *color=NULL)
add message info to buffer with cycle, level & message tag 'm'
Definition: logger.h:917
void addTriangle(const std::int32_t level, const double x1, const double y1, const double x2, const double y2, const double x3, const double y3, const int r, const int g, const int b, const bool fill=false)
add triangle info to buffer with cycle, level & message tag 't'
static const std::int32_t LEVEL_16
log level definition variable
Definition: logger.h:72
void addCircle(const std::int32_t level, const Vector2D ¢er, const double radius, const char *color=NULL, const bool fill=false)
add circle info to buffer with cycle, level & message tag 'c'
Definition: logger.h:471
static const std::int32_t KICK
log level definition alias
Definition: logger.h:125
static const std::int32_t LEVEL_03
log level definition variable
Definition: logger.h:59
static const std::int32_t LEVEL_29
log level definition variable
Definition: logger.h:85
void setLogFlag(const GameTime *time, const std::int32_t level, const bool on=true)
set new log level
static const std::int32_t BLOCK
log level definition alias
Definition: logger.h:132
static const std::int32_t LEVEL_14
log level definition variable
Definition: logger.h:70
void openStandardError()
use standard error to record
static const std::int32_t LEVEL_32
log level definition variable
Definition: logger.h:88
static const std::int32_t CLEAR
log level definition alias
Definition: logger.h:131
void addPoint(const std::int32_t level, const double x, const double y, const int r, const int g, const int b)
add point info to buffer with cycle, level & message tag 'p'
static const std::int32_t LEVEL_ANY
log level definition variable
Definition: logger.h:145
void addCircle(const std::int32_t level, const double x, const double y, const double radius, const char *color=NULL, const bool fill=false)
add circle info to buffer with cycle, level & message tag 'c'
static const std::int32_t INTERCEPT
log level definition alias
Definition: logger.h:124
static const std::int32_t TEAM
log level definition alias
Definition: logger.h:136
void addRect(const std::int32_t level, const Rect2D &rect, const int r, const int g, const int b, const bool fill=false)
add rect info to buffer with cycle, level & message tag 'r'
Definition: logger.h:756
static const std::int32_t LEVEL_04
log level definition variable
Definition: logger.h:60
static const std::int32_t LEVEL_30
log level definition variable
Definition: logger.h:86
static const std::int32_t TRAINING
log level definition alias
Definition: logger.h:143
static const std::int32_t LEVEL_17
log level definition variable
Definition: logger.h:73
static const std::int32_t PLAN
log level definition alias
Definition: logger.h:141
static const std::int32_t LEVEL_20
log level definition variable
Definition: logger.h:76
void addPoint(const std::int32_t level, const Vector2D &pos, const int r, const int g, const int b)
add point info to buffer with cycle, level & message tag 'p'
Definition: logger.h:296
static const std::int32_t ROLE
log level definition alias
Definition: logger.h:135
void flush()
flush stored message
void addSector(const std::int32_t level, const Vector2D ¢er, const double min_radius, const double max_radius, const AngleDeg &start_angle, const double span_angle, const int r, const int g, const int b, const bool fill=false)
add arc info to the buffer. message tag 'a'
Definition: logger.h:854
void addSector(const std::int32_t level, const double x, const double y, const double min_radius, const double max_radius, const AngleDeg &start_angle, const double span_angle, const char *color=NULL, const bool fill=false)
add arc info to the buffer. message tag 'a'
static const std::int32_t LEVEL_13
log level definition variable
Definition: logger.h:69
static const std::int32_t SENSOR
log level definition alias
Definition: logger.h:121
static const std::int32_t LEVEL_09
log level definition variable
Definition: logger.h:65
void addArc(const std::int32_t level, const Vector2D ¢er, const double radius, const AngleDeg &start_angle, const double span_angle, const char *color=NULL)
add arc info to the buffer. message tag 'a'
Definition: logger.h:396
void addRect(const std::int32_t level, const double left, const double top, const double length, const double width, const char *color=NULL, const bool fill=false)
add rect info to buffer with cycle, level & message tag 'r'
void open(const std::string &filepath)
open file to record
static const std::int32_t LEVEL_22
log level definition variable
Definition: logger.h:78
static const std::int32_t DRIBBLE
log level definition alias
Definition: logger.h:127
Logger()
allocate message buffer memory
static const std::int32_t LEVEL_08
log level definition variable
Definition: logger.h:64
2D rectangle regin class.
Definition: rect_2d.h:59
double left() const
get the left x coordinate of this rectangle.
Definition: rect_2d.h:602
const Size2D & size() const
get the XY range of this rectangle
Definition: rect_2d.h:674
double top() const
get the top y coordinate of this rectangle.
Definition: rect_2d.h:620
2D sector region(OUGI-GATA) class
Definition: sector_2d.h:45
double length() const
get the value of X range
Definition: size_2d.h:113
double width() const
get the value of Y range
Definition: size_2d.h:122
2D triangle class
Definition: triangle_2d.h:49
const Vector2D & b() const
get 2nd point
Definition: triangle_2d.h:143
const Vector2D & c() const
get 3rd point
Definition: triangle_2d.h:152
const Vector2D & a() const
get 1st point
Definition: triangle_2d.h:134
2D point vector class
Definition: vector_2d.h:46
double y
Y coordinate.
Definition: vector_2d.h:64
double x
X coordinate.
Definition: vector_2d.h:63
2D rectangle region Header File.
2D sector region Header File.
2D triangle class Header File.
2d vector class Header File.