Permalink
Browse files

console, break: deprecated TextColor object.

  • Loading branch information...
xicilion committed Oct 31, 2017
1 parent 3e13010 commit 1f62211b25f79de36dbc426d54361df00c85cd87
View
@@ -96,7 +96,6 @@
<ClInclude Include="include\AsyncCall.h" />
<ClInclude Include="include\AsyncIO.h" />
<ClInclude Include="include\AsyncWaitHandler.h" />
<ClInclude Include="include\BlockQueue.h" />
<ClInclude Include="include\Buffer.h" />
<ClInclude Include="include\BufferedStream.h" />
<ClInclude Include="include\Chain.h" />
@@ -144,7 +143,6 @@
<ClInclude Include="include\MongoID.h" />
<ClInclude Include="include\NullHandler.h" />
<ClInclude Include="include\PKey.h" />
<ClInclude Include="include\Queue.h" />
<ClInclude Include="include\QuickArray.h" />
<ClInclude Include="include\Redis.h" />
<ClInclude Include="include\RedisHash.h" />
@@ -381,8 +379,6 @@
<ClCompile Include="src\base\utils.cpp" />
<ClCompile Include="src\base\v8_api.cpp" />
<ClCompile Include="src\collection\Map.cpp" />
<ClCompile Include="src\collection\Queue.cpp" />
<ClCompile Include="src\console\TextColor.cpp" />
<ClCompile Include="src\console\console.cpp" />
<ClCompile Include="src\console\console_event.cpp" />
<ClCompile Include="src\console\console_file.cpp" />
@@ -396,7 +392,6 @@
<ClCompile Include="src\console\tty.cpp" />
<ClCompile Include="src\console\windows\console_windows_key.cpp" />
<ClCompile Include="src\console\windows\console_windows_mouse.cpp" />
<ClCompile Include="src\coroutine\BlockQueue.cpp" />
<ClCompile Include="src\coroutine\Condition.cpp" />
<ClCompile Include="src\coroutine\Event.cpp" />
<ClCompile Include="src\coroutine\Fiber.cpp" />
@@ -129,9 +129,6 @@
<ClInclude Include="include\AsyncWaitHandler.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\BlockQueue.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Buffer.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -273,9 +270,6 @@
<ClInclude Include="include\PKey.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Queue.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\QuickArray.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -971,12 +965,6 @@
<ClCompile Include="src\collection\Map.cpp">
<Filter>Source Files\collection</Filter>
</ClCompile>
<ClCompile Include="src\collection\Queue.cpp">
<Filter>Source Files\collection</Filter>
</ClCompile>
<ClCompile Include="src\console\TextColor.cpp">
<Filter>Source Files\console</Filter>
</ClCompile>
<ClCompile Include="src\console\console.cpp">
<Filter>Source Files\console</Filter>
</ClCompile>
@@ -1016,9 +1004,6 @@
<ClCompile Include="src\console\windows\console_windows_mouse.cpp">
<Filter>Source Files\console\windows</Filter>
</ClCompile>
<ClCompile Include="src\coroutine\BlockQueue.cpp">
<Filter>Source Files\coroutine</Filter>
</ClCompile>
<ClCompile Include="src\coroutine\Condition.cpp">
<Filter>Source Files\coroutine</Filter>
</ClCompile>
View
@@ -96,7 +96,6 @@
<ClInclude Include="include\AsyncCall.h" />
<ClInclude Include="include\AsyncIO.h" />
<ClInclude Include="include\AsyncWaitHandler.h" />
<ClInclude Include="include\BlockQueue.h" />
<ClInclude Include="include\Buffer.h" />
<ClInclude Include="include\BufferedStream.h" />
<ClInclude Include="include\Chain.h" />
@@ -144,7 +143,6 @@
<ClInclude Include="include\MongoID.h" />
<ClInclude Include="include\NullHandler.h" />
<ClInclude Include="include\PKey.h" />
<ClInclude Include="include\Queue.h" />
<ClInclude Include="include\QuickArray.h" />
<ClInclude Include="include\Redis.h" />
<ClInclude Include="include\RedisHash.h" />
@@ -381,8 +379,6 @@
<ClCompile Include="src\base\utils.cpp" />
<ClCompile Include="src\base\v8_api.cpp" />
<ClCompile Include="src\collection\Map.cpp" />
<ClCompile Include="src\collection\Queue.cpp" />
<ClCompile Include="src\console\TextColor.cpp" />
<ClCompile Include="src\console\console.cpp" />
<ClCompile Include="src\console\console_event.cpp" />
<ClCompile Include="src\console\console_file.cpp" />
@@ -396,7 +392,6 @@
<ClCompile Include="src\console\tty.cpp" />
<ClCompile Include="src\console\windows\console_windows_key.cpp" />
<ClCompile Include="src\console\windows\console_windows_mouse.cpp" />
<ClCompile Include="src\coroutine\BlockQueue.cpp" />
<ClCompile Include="src\coroutine\Condition.cpp" />
<ClCompile Include="src\coroutine\Event.cpp" />
<ClCompile Include="src\coroutine\Fiber.cpp" />
@@ -129,9 +129,6 @@
<ClInclude Include="include\AsyncWaitHandler.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\BlockQueue.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Buffer.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -273,9 +270,6 @@
<ClInclude Include="include\PKey.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Queue.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\QuickArray.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -971,12 +965,6 @@
<ClCompile Include="src\collection\Map.cpp">
<Filter>Source Files\collection</Filter>
</ClCompile>
<ClCompile Include="src\collection\Queue.cpp">
<Filter>Source Files\collection</Filter>
</ClCompile>
<ClCompile Include="src\console\TextColor.cpp">
<Filter>Source Files\console</Filter>
</ClCompile>
<ClCompile Include="src\console\console.cpp">
<Filter>Source Files\console</Filter>
</ClCompile>
@@ -1016,9 +1004,6 @@
<ClCompile Include="src\console\windows\console_windows_mouse.cpp">
<Filter>Source Files\console\windows</Filter>
</ClCompile>
<ClCompile Include="src\coroutine\BlockQueue.cpp">
<Filter>Source Files\coroutine</Filter>
</ClCompile>
<ClCompile Include="src\coroutine\Condition.cpp">
<Filter>Source Files\coroutine</Filter>
</ClCompile>
View
@@ -8,8 +8,6 @@
#ifndef TEXTCOLOR_H_
#define TEXTCOLOR_H_
#include "ifs/TextColor.h"
namespace fibjs {
#define COLOR_RESET "\x1b[0m"
@@ -33,34 +31,6 @@ namespace fibjs {
#define COLOR_LIGHTWHITE "\x1b[1;37m" /* White */
#define COLOR_TITLE "\x1B[1;39m"
class TextColor : public TextColor_base {
public:
TextColor()
{
m_error = COLOR_LIGHTRED;
m_warn = COLOR_YELLOW;
m_notice = COLOR_GREEN;
m_highLight = COLOR_TITLE;
}
public:
// TextColor_base
virtual result_t get_notice(exlib::string& retVal);
virtual result_t set_notice(exlib::string newVal);
virtual result_t get_warn(exlib::string& retVal);
virtual result_t set_warn(exlib::string newVal);
virtual result_t get_error(exlib::string& retVal);
virtual result_t set_error(exlib::string newVal);
virtual result_t get_highLight(exlib::string& retVal);
virtual result_t set_highLight(exlib::string newVal);
public:
exlib::string m_notice;
exlib::string m_warn;
exlib::string m_error;
exlib::string m_highLight;
};
}
#endif /* STAT_H_ */
View
@@ -188,28 +188,26 @@ class logger : public AsyncEvent {
}
public:
static exlib::string& notice()
static exlib::string notice()
{
return get_std_color()->m_notice;
return COLOR_GREEN;
}
static exlib::string& warn()
static exlib::string warn()
{
return get_std_color()->m_warn;
return COLOR_YELLOW;
}
static exlib::string& error()
static exlib::string error()
{
return get_std_color()->m_error;
return COLOR_LIGHTRED;
}
static exlib::string& highLight()
static exlib::string highLight()
{
return get_std_color()->m_highLight;
return COLOR_TITLE;
}
static TextColor* get_std_color();
protected:
exlib::List<item> m_workinglogs;
@@ -16,8 +16,6 @@
namespace fibjs {
class TextColor_base;
class console_base : public object_base {
DECLARE_CLASS(console_base);
@@ -39,7 +37,6 @@ class console_base : public object_base {
// console_base
static result_t get_loglevel(int32_t& retVal);
static result_t set_loglevel(int32_t newVal);
static result_t get_colors(obj_ptr<TextColor_base>& retVal);
static result_t get_width(int32_t& retVal);
static result_t get_height(int32_t& retVal);
static result_t add(exlib::string type);
@@ -110,7 +107,6 @@ class console_base : public object_base {
static void s_get_NOTSET(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args);
static void s_get_loglevel(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args);
static void s_set_loglevel(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& args);
static void s_get_colors(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args);
static void s_get_width(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args);
static void s_get_height(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args);
static void s_add(const v8::FunctionCallbackInfo<v8::Value>& args);
@@ -148,8 +144,6 @@ class console_base : public object_base {
};
}
#include "TextColor.h"
namespace fibjs {
inline ClassInfo& console_base::class_info()
{
@@ -198,7 +192,6 @@ inline ClassInfo& console_base::class_info()
{ "PRINT", s_get_PRINT, block_set, true },
{ "NOTSET", s_get_NOTSET, block_set, true },
{ "loglevel", s_get_loglevel, s_set_loglevel, true },
{ "colors", s_get_colors, block_set, true },
{ "width", s_get_width, block_set, true },
{ "height", s_get_height, block_set, true }
};
@@ -316,18 +309,6 @@ inline void console_base::s_set_loglevel(v8::Local<v8::String> property, v8::Loc
PROPERTY_SET_LEAVE();
}
inline void console_base::s_get_colors(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args)
{
obj_ptr<TextColor_base> vr;
METHOD_NAME("console.colors");
PROPERTY_ENTER();
hr = get_colors(vr);
METHOD_RETURN();
}
inline void console_base::s_get_width(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args)
{
int32_t vr;

This file was deleted.

Oops, something went wrong.
@@ -87,12 +87,6 @@ result_t console_base::set_loglevel(int32_t newVal)
return 0;
}
result_t console_base::get_colors(obj_ptr<TextColor_base>& retVal)
{
retVal = logger::get_std_color();
return 0;
}
result_t console_base::add(exlib::string type)
{
Isolate* isolate = Isolate::current();
@@ -11,16 +11,6 @@
namespace fibjs {
TextColor* logger::get_std_color()
{
static obj_ptr<TextColor> s_tc;
if (!s_tc)
s_tc = new TextColor;
return s_tc;
}
#ifdef _WIN32
void std_logger::out(exlib::string& txt)
Oops, something went wrong.

0 comments on commit 1f62211

Please sign in to comment.