ProfilingFormater.cc
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00013 #include <sys/time.h>
00014
00015 #include <iostream>
00016 #include <fstream>
00017 #include <string>
00018
00019 #include "zypp/base/Logger.h"
00020 #include "zypp/base/LogControl.h"
00021 #include "zypp/base/String.h"
00022 #include "zypp/Date.h"
00023 #include "zypp/PathInfo.h"
00024
00025
00026 #include "zypp/base/ProfilingFormater.h"
00027
00028 using std::endl;
00029
00031 namespace zypp
00032 {
00033
00034 namespace base
00035 {
00036
00038
00040
00041 std::string ProfilingFormater::format( const std::string & group_r,
00042 logger::LogLevel level_r,
00043 const char * file_r,
00044 const char * func_r,
00045 int line_r,
00046 const std::string & message_r )
00047 {
00048 struct timeval tp;
00049 int rtn;
00050 rtn = gettimeofday( &tp, NULL);
00051
00052 return str::form( "%ld.%ld [%d] <%d> %s(%s):%d %s",
00053 tp.tv_sec,
00054 tp.tv_usec,
00055 level_r,
00056 getpid(),
00057
00058 file_r, func_r, line_r,
00059 message_r.c_str() );
00060 }
00062 }
00065 }