2014-05-05 21:30:39 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2000-04-18 06:34:54 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Base implementation for console messages.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsConsoleMessage.h"
|
2013-05-24 22:36:56 +04:00
|
|
|
#include "jsapi.h"
|
2000-04-18 06:34:54 +04:00
|
|
|
|
2014-04-27 11:06:00 +04:00
|
|
|
NS_IMPL_ISUPPORTS(nsConsoleMessage, nsIConsoleMessage)
|
2000-04-18 06:34:54 +04:00
|
|
|
|
2013-05-24 22:36:56 +04:00
|
|
|
nsConsoleMessage::nsConsoleMessage() : mTimeStamp(0), mMessage() {}
|
2000-08-22 09:54:25 +04:00
|
|
|
|
2014-05-13 21:41:38 +04:00
|
|
|
nsConsoleMessage::nsConsoleMessage(const char16_t* aMessage) {
|
2013-05-24 22:36:56 +04:00
|
|
|
mTimeStamp = JS_Now() / 1000;
|
2014-05-13 21:41:38 +04:00
|
|
|
mMessage.Assign(aMessage);
|
2000-08-22 09:54:25 +04:00
|
|
|
}
|
|
|
|
|
2000-04-18 06:34:54 +04:00
|
|
|
NS_IMETHODIMP
|
2018-09-05 06:31:42 +03:00
|
|
|
nsConsoleMessage::GetMessageMoz(nsAString& aMessage) {
|
|
|
|
aMessage = mMessage;
|
2013-05-24 22:36:56 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2000-04-18 06:34:54 +04:00
|
|
|
|
2014-09-23 02:32:21 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsConsoleMessage::GetLogLevel(uint32_t* aLogLevel) {
|
|
|
|
*aLogLevel = nsConsoleMessage::info;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2013-05-24 22:36:56 +04:00
|
|
|
NS_IMETHODIMP
|
2014-05-13 21:41:38 +04:00
|
|
|
nsConsoleMessage::GetTimeStamp(int64_t* aTimeStamp) {
|
2013-05-24 22:36:56 +04:00
|
|
|
*aTimeStamp = mTimeStamp;
|
|
|
|
return NS_OK;
|
2000-04-18 06:34:54 +04:00
|
|
|
}
|
|
|
|
|
2013-05-24 22:36:56 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsConsoleMessage::ToString(nsACString& /*UTF8*/ aResult) {
|
|
|
|
CopyUTF16toUTF8(mMessage, aResult);
|
2000-04-18 06:34:54 +04:00
|
|
|
|
2013-05-24 22:36:56 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|