Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Blue Logger
07-20-2018, 05:57 PM
Post: #11
RE: Blue Logger
(05-03-2018 04:20 PM)lingu Wrote:  We need specify how to use blue logger in the code, such as the code sequence in auntie.cpp.

Code:
puser = getenv("USER");
  psageuser = getenv("sage_user");
  if (!psageuser) {
    psageuser = puser;
  }
  string logfile = "/thinker/local/today/users/";
  logfile += puser;
  mkdir(logfile.c_str(), 0755);
  logfile += "/auntie.log";
  //  printf("auntie: log to %s\n", logfile.c_str());                          
  initBlueLog(logfile.c_str());
  BlueLog::slogA("\n\nauntie ::", argv[0]);

We should simplify this code sequence. Ideally, it should take just one statement to initialize the log.

Qiracle pls look into it. Zhiqiang pls supervise the work.

?
Find all posts by this user
Quote this message in a reply
07-20-2018, 05:58 PM
Post: #12
RE: Blue Logger
At present, a var blue::LOG_TO_ERR_TOO controls whether the log messages are also printed to stderr. I suggest we change the name to blue::LOG_TO_STDERR_TOO because ERR is a bit vague.

RR zma
Find all posts by this user
Quote this message in a reply
07-20-2018, 06:14 PM
Post: #13
RE: Blue Logger
(07-20-2018 05:57 PM)lingu Wrote:  
(05-03-2018 04:20 PM)lingu Wrote:  We need specify how to use blue logger in the code, such as the code sequence in auntie.cpp.

Code:
puser = getenv("USER");
  psageuser = getenv("sage_user");
  if (!psageuser) {
    psageuser = puser;
  }
  string logfile = "/thinker/local/today/users/";
  logfile += puser;
  mkdir(logfile.c_str(), 0755);
  logfile += "/auntie.log";
  //  printf("auntie: log to %s\n", logfile.c_str());                          
  initBlueLog(logfile.c_str());
  BlueLog::slogA("\n\nauntie ::", argv[0]);

We should simplify this code sequence. Ideally, it should take just one statement to initialize the log.

Qiracle pls look into it. Zhiqiang pls supervise the work.

?

Sorry for missed it. Will to research it.
Find all posts by this user
Quote this message in a reply
07-20-2018, 06:48 PM
Post: #14
RE: Blue Logger
(07-20-2018 05:58 PM)lingu Wrote:  At present, a var blue::LOG_TO_ERR_TOO controls whether the log messages are also printed to stderr. I suggest we change the name to blue::LOG_TO_STDERR_TOO because ERR is a bit vague.

RR zma

OK
Quote this message in a reply
07-23-2018, 12:16 PM (This post was last modified: 07-23-2018 12:16 PM by qiracle.)
Post: #15
RE: Blue Logger
Driving example: http://tab.d-thinker.org/showthread.php?...http://tab.d-thinker.org/showthread.php?tid=5734&pid=7815

Quote:puser = getenv("USER");
psageuser = getenv("sage_user");
if (!psageuser) {
psageuser = puser;
}
string logfile = "/thinker/local/today/users/";
logfile += puser;
mkdir(logfile.c_str(), 0755);

These logics define the log path. I think these logics can be placed in cod://bluelogger/src/blue_logger.cpp. Then when we want to initialize the blue_log , we only should initBlueLog(logFileName).

RR xwcwt
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: