Permalink
Browse files

doc: Moved to 'tests' instead of 'unittest', Grinder added

  • Loading branch information...
MikeMitterer committed Dec 3, 2015
1 parent a3ee0e5 commit 7afa41e46b911230ce7e81d29907b672c031e7e6
@@ -3,14 +3,17 @@
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/packages/console_log_handler" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/packages" />
<excludeFolder url="file://$MODULE_DIR$/test/packages" />
<excludeFolder url="file://$MODULE_DIR$/test/unit/logging/packages" />
<excludeFolder url="file://$MODULE_DIR$/test/unit/packages" />
<excludeFolder url="file://$MODULE_DIR$/test/unit/simple/packages" />
<excludeFolder url="file://$MODULE_DIR$/tool/packages" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="application" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
<component name="org.twodividedbyzero.idea.findbugs">
<option name="_basePreferences">
@@ -205,5 +208,4 @@
</map>
</option>
</component>
</module>

</module>
@@ -85,15 +85,15 @@ class LogConsoleHandler implements BaseLoggingHandler {
try {
makeGroupWithString(groupNameWithType,prettyPrintJson(error));

} on FormatException catch(e) {
} on FormatException {
makeGroupWithString(groupNameWithType,error.toString());
}
} else {
try {
final decoded = JSON.decode(error.toString());
makeGroupWithString(groupNameWithType,prettyPrintJson(decoded));

} on Exception catch(e) {
} on Exception {
makeGroupWithString(groupNameWithType,error.toString());
}

@@ -214,8 +214,7 @@ class ConsolStringTransformer implements LogRecordTransformer {
try {
formatString = formatString.replaceAll(regexp, dateFormat.format(logRecord.time));
}
on UnimplementedError
catch (e) {
on UnimplementedError {
// at time of writing, dateFormat.format seems to be unimplemented.
// so just return the time.toString()
formatString = formatString.replaceAll(regexp, logRecord.time.toString());
@@ -4,44 +4,184 @@ packages:
analyzer:
description: analyzer
source: hosted
version: "0.15.7"
version: "0.26.3"
ansicolor:
description: ansicolor
source: hosted
version: "0.0.9"
args:
description: args
source: hosted
version: "0.11.0+1"
version: "0.13.2"
async:
description: async
source: hosted
version: "1.4.0"
barback:
description: barback
source: hosted
version: "0.15.2+7"
browser:
description: browser
source: hosted
version: "0.10.0+2"
charcode:
description: charcode
source: hosted
version: "1.1.0"
cli_util:
description: cli_util
source: hosted
version: "0.0.1+2"
collection:
description: collection
source: hosted
version: "0.9.4"
version: "1.2.0"
convert:
description: convert
source: hosted
version: "1.0.1"
crypto:
description: crypto
source: hosted
version: "0.9.1"
csslib:
description: csslib
source: hosted
version: "0.12.2"
glob:
description: glob
source: hosted
version: "1.0.5"
grinder:
description: grinder
source: hosted
version: "0.8.0+1"
html:
description: html
source: hosted
version: "0.12.2"
http_multi_server:
description: http_multi_server
source: hosted
version: "1.3.2"
http_parser:
description: http_parser
source: hosted
version: "1.1.0"
intl:
description: intl
source: hosted
version: "0.11.3"
version: "0.12.4+2"
logging:
description: logging
source: hosted
version: "0.9.2"
version: "0.11.2"
logging_handlers:
description: logging_handlers
source: hosted
version: "0.8.0"
matcher:
description: matcher
source: hosted
version: "0.11.0"
version: "0.12.0+1"
mime:
description: mime
source: hosted
version: "0.9.3"
mockable_filesystem:
description: mockable_filesystem
source: hosted
version: "0.0.3"
package_config:
description: package_config
source: hosted
version: "0.1.3"
path:
description: path
source: hosted
version: "1.2.2"
version: "1.3.9"
petitparser:
description: petitparser
source: hosted
version: "1.5.0"
plugin:
description: plugin
source: hosted
version: "0.1.0"
pool:
description: pool
source: hosted
version: "1.2.1"
pub_semver:
description: pub_semver
source: hosted
version: "1.2.3"
shelf:
description: shelf
source: hosted
version: "0.6.4+2"
shelf_static:
description: shelf_static
source: hosted
version: "0.2.3+1"
shelf_web_socket:
description: shelf_web_socket
source: hosted
version: "0.0.1+4"
source_map_stack_trace:
description: source_map_stack_trace
source: hosted
version: "1.0.4"
source_maps:
description: source_maps
source: hosted
version: "0.10.1"
source_span:
description: source_span
source: hosted
version: "1.2.1"
stack_trace:
description: stack_trace
source: hosted
version: "1.0.2"
unittest:
description: unittest
version: "1.5.0"
string_scanner:
description: string_scanner
source: hosted
version: "0.1.4"
supports_color:
description: supports_color
source: hosted
version: "0.1.1"
test:
description: test
source: hosted
version: "0.12.6"
typed_data:
description: typed_data
source: hosted
version: "1.1.1"
unscripted:
description: unscripted
source: hosted
version: "0.6.2"
utf:
description: utf
source: hosted
version: "0.9.0+2"
watcher:
description: watcher
source: hosted
version: "0.9.7"
when:
description: when
source: hosted
version: "0.2.0"
which:
description: which
source: hosted
version: "0.1.3"
yaml:
description: yaml
source: hosted
version: "0.11.0+3"
version: "2.1.7"
@@ -6,11 +6,15 @@ description: Console logger

homepage: https://github.com/MikeMitterer/dart-console_log_handler

environment:
sdk: '>=1.12.0 <2.0.0'

dependencies:
browser: any
browser: ^0.10.0

logging: ">=0.9.2 <0.10.0"
logging_handlers: ">=0.8.0 <0.9.0"
logging: ^0.11.0
logging_handlers: ^0.8.0

dev_dependencies:
unittest: any
test: any
grinder: any

This file was deleted.

Oops, something went wrong.
@@ -1,7 +1,31 @@
part of unit.test;

testLogging() {
/*
* Copyright (c) 2015, Michael Mitterer (office@mikemitterer.at),
* IT-Consulting and Development Limited.
*
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

@TestOn("content-shell")
import 'package:test/test.dart';

import "package:console_log_handler/console_log_handler.dart";
import 'package:logging/logging.dart';

main() {
final Logger _logger = new Logger("unit.test.Logging");
configLogging();

group('Logging', () {
setUp(() {
@@ -31,6 +55,8 @@ testLogging() {
// end 'Logging' group
}

//------------------------------------------------------------------------------------------------
// Helper
//------------------------------------------------------------------------------------------------
void configLogging() {
hierarchicalLoggingEnabled = true;
Logger.root.level = Level.INFO;
Logger.root.onRecord.listen(new LogConsoleHandler());
}
@@ -1,7 +1,33 @@
part of unit.test;
/*
* Copyright (c) 2015, Michael Mitterer (office@mikemitterer.at),
* IT-Consulting and Development Limited.
*
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

testJsonPrettyPrint() {
final Logger _logger = new Logger("unit.test.JsonPrettyPrint");
@TestOn("content-shell")
import 'package:test/test.dart';

import 'dart:convert';

import "package:console_log_handler/console_log_handler.dart";
import 'package:logging/logging.dart';

main() {
// final Logger _logger = new Logger("unit.test.JsonPrettyPrint");
configLogging();

const JsonEncoder PRETTYJSON = const JsonEncoder.withIndent(' ');

@@ -57,6 +83,8 @@ testJsonPrettyPrint() {
// end 'JsonPrettyPrint' group
}

//------------------------------------------------------------------------------------------------
// Helper
//------------------------------------------------------------------------------------------------
void configLogging() {
hierarchicalLoggingEnabled = true;
Logger.root.level = Level.INFO;
Logger.root.onRecord.listen(new LogConsoleHandler());
}
Oops, something went wrong.

0 comments on commit 7afa41e

Please sign in to comment.