Reuse Log method
This commit is contained in:
parent
d686916fe2
commit
0740b2f66b
3 changed files with 11 additions and 13 deletions
|
@ -4,11 +4,10 @@
|
|||
|
||||
#include "atom/app/node_main.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "atom/app/uv_task_runner.h"
|
||||
#include "atom/browser/javascript_environment.h"
|
||||
#include "atom/browser/node_debugger.h"
|
||||
#include "atom/common/api/atom_bindings.h"
|
||||
#include "atom/common/native_mate_converters/string16_converter.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/feature_list.h"
|
||||
|
@ -22,10 +21,6 @@
|
|||
|
||||
namespace atom {
|
||||
|
||||
void Log(const base::string16& message) {
|
||||
std::cout << message << std::flush;
|
||||
}
|
||||
|
||||
int NodeMain(int argc, char *argv[]) {
|
||||
base::CommandLine::Init(argc, argv);
|
||||
|
||||
|
@ -59,10 +54,10 @@ int NodeMain(int argc, char *argv[]) {
|
|||
if (node_debugger.IsRunning())
|
||||
env->AssignToContext(v8::Debug::GetDebugContext());
|
||||
|
||||
node::LoadEnvironment(env);
|
||||
mate::Dictionary process(gin_env.isolate(), env->process_object());
|
||||
process.SetMethod("log", &AtomBindings::Log);
|
||||
|
||||
mate::Dictionary dict(gin_env.isolate(), env->process_object());
|
||||
dict.SetMethod("log", &Log);
|
||||
node::LoadEnvironment(env);
|
||||
|
||||
bool more;
|
||||
do {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue