Skip to content

Commit

Permalink
chore(main): Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
curtd committed May 27, 2023
0 parents commit 40b6928
Show file tree
Hide file tree
Showing 18 changed files with 799 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI
on:
push:
branches:
- main
tags: ['*']
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- '1.9'
- 'nightly'
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
show-versioninfo: true
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
with:
annotate: true
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
with:
file: lcov.info
- name: Submit coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
permissions:
contents: write
statuses: write
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- name: Configure doc environment
run: |
julia --project=docs/ -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
julia --project=docs -e '
using Documenter: DocMeta, doctest
using LoggingCommon
DocMeta.setdocmeta!(LoggingCommon, :DocTestSetup, :(using LoggingCommon); recursive=true)
doctest(LoggingCommon)'
16 changes: 16 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
31 changes: 31 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: 3
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/Manifest.toml
/docs/Manifest.toml
/docs/build/
*.code-workspace
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Curt Da Silva <curt.dasilva@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
16 changes: 16 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name = "LoggingCommon"
uuid = "44db15ec-78df-42c5-8c4e-36d253f36098"
authors = ["Curt Da Silva <curt.dasilva@gmail.com>"]
version = "1.0.0-DEV"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"

[compat]
Dictionaries = "0.3"
julia = "1.6"
PrecompileTools = "1"
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# LoggingCommon

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://curtd.github.io/LoggingCommon.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://curtd.github.io/LoggingCommon.jl/dev/)
[![Build Status](https://github.com/curtd/LoggingCommon.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/curtd/LoggingCommon.jl/actions/workflows/CI.yml?query=branch%3Amain)
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
LoggingCommon = "44db15ec-78df-42c5-8c4e-36d253f36098"
32 changes: 32 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Documenter

using Pkg
docs_dir = joinpath(@__DIR__, "..")
project_dir = isempty(ARGS) ? @__DIR__() : joinpath(pwd(), ARGS[1])
Pkg.activate(project_dir)

using LoggingCommon

DocMeta.setdocmeta!(LoggingCommon, :DocTestSetup, :(using LoggingCommon); recursive=true)

makedocs(;
modules=[LoggingCommon],
authors="Curt Da Silva",
repo="https://github.com/curtd/LoggingCommon.jl/blob/{commit}{path}#{line}",
sitename="LoggingCommon.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://curtd.github.io/LoggingCommon.jl",
edit_link="main",
assets=String[],
),
pages=[
"Home" => "index.md",
"API" => "api.md"
],
)

deploydocs(;
repo="github.com/curtd/LoggingCommon.jl.git",
devbranch="main", push_preview=true
)
19 changes: 19 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# API

## Logging Levels

```@autodocs
Modules = [LoggingCommon]
Order = [:constant, :type, :function]
Pages = ["levels.jl"]
Private = false
```

## Logging Records

```@autodocs
Modules = [LoggingCommon]
Order = [:constant, :type, :function]
Pages = ["records.jl"]
Private = false
```
7 changes: 7 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```@meta
CurrentModule = LoggingCommon
```

# LoggingCommon

[LoggingCommon](https://github.com/curtd/LoggingCommon.jl) provides some definitions that are useful as the basis for creating a generic logging framework, slightly extending the types and methods introduced in [`Base.Logging`](https://docs.julialang.org/en/v1/stdlib/Logging/).
37 changes: 37 additions & 0 deletions src/LoggingCommon.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module LoggingCommon

using Dates, Dictionaries, Distributed, Logging, PrecompileTools

# Log levels
export NotSet, All, Trace,Notice, Critical, Alert, Emergency, Fatal, AboveMax, Off

# Reexport Base.Logging levels
export Debug, Info, Warn, Error

export UnknownLogLevelException

export NamedLogLevel

export log_level, log_level_name, is_valid_log_level, validate_log_level, nearest_log_level

# Log records
export StaticLogRecordMetadata, RuntimeLogRecordMetadata, LogRecordData

export AbstractLogRecord, LogRecord, MessageLogRecord, StacktraceLogRecord

export message_log_record, stacktrace_log_record

export log_record_data, static_metadata, runtime_metadata, is_error_record

# Part of the public API but not exported
#
# Constants:
# available_log_levels, available_named_log_levels

include("levels.jl")

include("records.jl")

include("precompile.jl")

end

0 comments on commit 40b6928

Please sign in to comment.