22 #ifndef SINGA_UTILS_CHANNEL_H_ 23 #define SINGA_UTILS_CHANNEL_H_ 25 #include <google/protobuf/message.h> 37 explicit Channel(
const std::string& name);
41 inline const std::string&
GetName() {
return name_; }
50 void Send(
const std::string& message);
52 void Send(
const google::protobuf::Message& message);
55 std::string name_ =
"";
67 void SetDefaultDir(
const char* dir);
68 Channel* GetInstance(
const std::string& channel);
71 std::string dir_ =
"";
72 std::map<std::string, Channel*> name2ptr_;
85 #endif // SINGA_UTILS_CHANNEL_H__ const std::string & GetName()
Return the channel name, which is also used for naming the output file.
Definition: channel.h:41
void Send(const std::string &message)
Append a string message.
void EnableDestStderr(bool enable)
Disabled by default.
Definition: channel.h:43
void EnableDestFile(bool enable)
Enabled by default.
Definition: channel.h:45
void SetChannelDirectory(const char *path)
Set the directory name for persisting channel content.
void SetDestFilePath(const std::string &file)
Reset the output file path.
Channel for appending metrics or other information into files or screen.
Definition: channel.h:35
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: common.h:48
Channel * GetChannel(const std::string &channel_name)
Get the channel instance.
void InitChannel(const char *argv)
Initial function for global usage of channel.