OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "remoting/host/dev_net_log.h" | |
6 | |
7 #include "base/json/json_writer.h" | |
8 #include "base/logging.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/time.h" | |
11 #include "base/threading/thread_restrictions.h" | |
12 #include "base/values.h" | |
13 | |
14 namespace remoting { | |
15 | |
16 DevNetLog::DevNetLog() : id_(0) { | |
17 } | |
18 | |
19 DevNetLog::~DevNetLog() { | |
20 } | |
21 | |
22 void DevNetLog::AddEntry( | |
23 EventType type, | |
24 const Source& source, | |
25 EventPhase phase, | |
26 const scoped_refptr<EventParameters>& params) { | |
27 | |
Sergey Ulanov
2012/04/13 00:55:33
Don't need this empty line.
alexeypa (please no reviews)
2012/04/13 18:28:22
Done.
| |
28 scoped_ptr<Value> value( | |
29 net::NetLog::EntryToDictionaryValue( | |
30 type, base::TimeTicks::Now(), source, phase, params, false)); | |
31 // Don't pretty print, so each JSON value occupies a single line, with no | |
32 // breaks (Line breaks in any text field will be escaped). Using strings | |
33 // instead of integer identifiers allows logs from older versions to be | |
34 // loaded, though a little extra parsing has to be done when loading a log. | |
35 std::string json; | |
36 base::JSONWriter::Write(value.get(), &json); | |
37 VLOG(3) << json; | |
38 } | |
39 | |
40 uint32 DevNetLog::NextID() { | |
41 return id_++; | |
42 } | |
43 | |
44 net::NetLog::LogLevel DevNetLog::GetLogLevel() const { | |
45 return LOG_ALL_BUT_BYTES; | |
46 } | |
47 | |
48 void DevNetLog::AddThreadSafeObserver(ThreadSafeObserver* observer, | |
49 net::NetLog::LogLevel log_level) { | |
50 NOTIMPLEMENTED(); | |
51 } | |
52 | |
53 void DevNetLog::SetObserverLogLevel(ThreadSafeObserver* observer, | |
54 net::NetLog::LogLevel log_level) { | |
55 NOTIMPLEMENTED(); | |
56 } | |
57 | |
58 void DevNetLog::RemoveThreadSafeObserver(ThreadSafeObserver* observer) { | |
59 NOTIMPLEMENTED(); | |
60 } | |
61 | |
62 } // namespace remoting | |
OLD | NEW |